Bug 24512 - rpm does not close pipes correctly
Summary: rpm does not close pipes correctly
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gpm
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Preston Brown
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
: 36400 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-01-21 18:50 UTC by Gerald Teschl
Modified: 2007-04-18 16:30 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2001-02-09 15:59:31 UTC


Attachments (Terms of Use)

Description Gerald Teschl 2001-01-21 18:50:00 UTC
If I pipe the rpm output to another command, it sometimes happens that rpm
does not close the pipe correctly. The other command will wait forever
while rpm already terminated.

For example. Suppose you have

gpm-1.19.3-6.i386.rpm        gpm-devel-1.19.3-6.i386.rpm

installed and you say

rpm -vF gpm-1.19.3-7.i386.rpm gpm-devel-1.19.3-7.i386.rpm | grep gpm

then rpm will finish but grep waits forever.

Comment 1 Glen Foster 2001-01-22 17:41:04 UTC
This defect is considered MUST-FIX for Florence Gold release

Comment 2 Jeff Johnson 2001-01-22 18:10:56 UTC
This is a gpm packaging problem, verifed by doing
	rpm -Fv --noscripts gpm* | grep gpm

Comment 3 Gerald Teschl 2001-01-23 16:48:16 UTC
It happens with other packages as well.

Comment 4 Gerald Teschl 2001-01-23 18:08:59 UTC
For example with:

autofs-3.1.7-5
openssh-2.3.0p1
vixie-cron-3.0.1-57

Could it be that this is related to #18988 ?

I still think this is an rpm and not a gpm/openssh/packaging problem.

Comment 5 Gerald Teschl 2001-01-24 12:01:44 UTC
I just had another look at the problem. The gpm daemon still has the pipe open
for writing
after rpm has quit. However, since gmp is restarted as

service gpm stop >/dev/null 2>&

in the post script, it doesn't have the pipe as STDOUT/ERR but /dev/null. So
where did it get it
from?


Comment 6 Preston Brown 2001-01-31 22:33:49 UTC
still an RPM issue.

Comment 7 Jeff Johnson 2001-02-01 14:17:30 UTC
Again, I repeat:

If you install gpm with --noscripts, the install does not "hang". That means
that the
problem is in packaging,  and the fix is in packaging, and the bug report needs
to
be against the package(s), not rpm, as there's no way that I can "fix" (i.e. by
changing the
execution environment of rpm scriptlets) without introducing legacy
incompatibilities (i.e. by
changing the execution environment of rpm scriptlets) at this point in a release
cycle.

So, back to gpm, which needs to close open file descriptors when starting as
daemon.

Please open separate bugs for the "me too" packages, as this bug is about gpm,
and it's
unclear whether the other packages have this or another problem.

Comment 8 Glen Foster 2001-02-01 15:43:49 UTC
This defect has been removed from the Florence Gold MUST-FIX list

Comment 9 Gerald Teschl 2001-02-09 15:59:27 UTC
My guess is the following: Rpm redirects stdout/err but keeps a copy of the
original stdout/err so it can be restored later. Then it does a fork and the
child execs the script. However, the
child does forget to close the copy of the filehandle and so all subsequent
processes inherit it.

Comment 10 Preston Brown 2001-06-25 17:14:57 UTC
looking through the code, it looks like there are several reasons that stderr isn't 
closed during startup of gpm.  Here's a comment:

  /* FIXME: stderr must be closed at this point, as protocol init needs it */ 

As this bug isn't critical, and it seems we might introduce more problems than we 
solve by messing with the code, I'm closing this WONTFIX.


Comment 11 Preston Brown 2001-06-25 17:17:06 UTC
*** Bug 36400 has been marked as a duplicate of this bug. ***

Comment 12 Preston Brown 2001-07-19 16:00:58 UTC
*** Bug 36400 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.