Bug 13499 - Opening a pipe to a command no longer functional
Summary: Opening a pipe to a command no longer functional
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdb
Version: 6.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-07-05 14:00 UTC by Kenneth Brunsen
Modified: 2008-05-01 15:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-08-11 17:04:25 UTC
Embargoed:


Attachments (Terms of Use)

Description Kenneth Brunsen 2000-07-05 14:00:29 UTC
This appears to be specific to RH 6.2, as I was able to take the 
perl-5.00503-10 RPM from RH 6.2 and apply it to an RH 6.1 system and the 
bug does not show up.  On RH 6.2, opening a pipe to a command is not 
functioning correctly such that orders are not sent to the command and the 
handle is not in blocking mode.  For example

<script stuff>

open(DEBUG_HANDLE, "|gdb $name $PID");
print DEBUG_HANDLE "where\n";
print DEBUG_HANDLE "detach\n";
print DEBUG_HANDLE "quit\n";
close DEBUG_HANDLE;

<more script stuff>

the code attaching to gdb will no longer work in a perl script, and results 
in the debugger hanging attached to the process because it has recieved 
none of the commands while perl reports an error on stdin and continues 
executing any further perl commands.

If more information is needed, I can provide it.  This issue has shown up 
on a customer site and I've been able to duplicate it on a base RH 6.2 
system myself.

Thank you,

Kenneth Brunsen
Iris Associates

Comment 1 Nalin Dahyabhai 2000-07-21 18:14:02 UTC
Does this still show up when using another tool to feed commands to gdb?

Comment 2 Kenneth Brunsen 2000-07-25 12:43:58 UTC
Tested standalone gdb with the command "tail -f foo | gdb /bin/ls"  and echoing commands into foo showed up and were executed by gdb - so it still 
appears to be something wrong in perl specifically.

Comment 3 Nalin Dahyabhai 2000-07-27 20:40:08 UTC
Then I suspect this is gdb's behavior rather than perl's.  On a Raw Hide
system with gdb 5.0, this no longer occurs.

Comment 4 Trond Eivind Glomsrxd 2000-07-27 22:48:19 UTC
Does it show up on a 6.2 system with 6.1 gdb?

Comment 5 Trond Eivind Glomsrxd 2000-08-04 14:44:08 UTC
Works with the pinstripe beta.

Comment 6 Kenneth Brunsen 2000-08-04 19:00:58 UTC
Can you tell me what the "pinstripe" beta/RAWHIDE is/are and what the planned availability is?  At present, we're writing a Release Note for Lotus 
Domino Release 5.05 which will state that our debug tool "nsd" is unable to run on RH 6.2 due to a bug in perl/gdb on RH6.2 - it'd be nice to also put 
something in stating a workaround to allow this to work - "nsd" is our primary tool for capturing debug information in the field on problems/crashes with 
the Lotus Domino product.  Thanks! kenbo

Comment 7 Trond Eivind Glomsrxd 2000-08-04 19:18:39 UTC
RawHide is a recent cut from out build trees (available from our ftp site and
some mirrors), pinstripe is a beta of the upcoming 7.0.

Do you have a sample script which demonstrates your behaviour?
And did you try the gdb and/or perl from 6.1 on the 6.2 system?

Comment 8 Kenneth Brunsen 2000-08-07 13:41:11 UTC
I just duplicated the bug on my RH 6.1 machine for the first time by upgrading gdb to the gdb shipping with RH 6.2 - so it looks like you are right and it is 
a gdb issue.  I will download the latest gdb from your site and see if it still happens or if it is gone.  Thanks.  kenbo

Comment 9 Kenneth Brunsen 2000-08-07 17:30:55 UTC
I cannot install the rawhide verion of gdb as it's major number is > 3 and rpm will not handle it; niether can I upgrade rpm to new version with rawhide for 
the same reason.  In order to verify that the gdb from rawhide fixes the issue, I need to be able to install this gdb on a RH 6.1 or RH 6.2 machine - is this 
possible then?  Thanks.  kenbo

Comment 10 Trond Eivind Glomsrxd 2000-08-08 19:03:13 UTC
Tried rpm 3.0.5 from ftp.rpm.org? (which will be an update RSN - possibly today
or tomorrow)

Comment 11 Kenneth Brunsen 2000-08-10 14:24:58 UTC
Ok, I installed rpm 3.0.5.x from ftp.rpm.org and it allows me to install the > 3 packages.  However, gdb-5.05 requires libncurses.so.5 and libc.so.6 - both 
of which basically require me to upgrade my OS to rawhide, which is not acceptable as a "fix" to running Domino/Notes on RH6.2.  Any other ideas?  If 
not, we're gonna have to just go with the release note that says that nsd does not work on RH6.2 due to a bug in gdb. Thanks!  kenbo

Comment 12 Trond Eivind Glomsrxd 2000-08-10 14:31:26 UTC
Try rebuilding the SRPM... we are thinking of doing an errata of this. If you
could confirm that it is actually working, that would be one more reason for
doing so.

Comment 13 Kenneth Brunsen 2000-08-10 15:39:50 UTC
Rebuilt the gdb-5.0 and it is better, but still not fully working.  Now it does not remain attached to the processes, but it is still failing to gain commands.  
Here is a sample output of a run conclusion:

Reading symbols ...
Loaded symbols ...
0x40xxxxx in __select () from ...
(gdb) Hangup deteced on fd 0
error detected on stdin
Detaching from program: /opt/lotus/notes/latest/linux/server, Thread x

Since there is no place on here for attachments, I will send you email with a modified version of nsd.pl, called nsd_test.pl
which you can use to duplicate the bug by running it with a find command running in the background - I've put some
directions in the top of the file on how to run it and how to modify the script to do more.  Hopefully this will help in 
finding a cure.  Thanks!  kenbo


Comment 14 Daniel Berlin 2000-08-11 17:04:23 UTC
Sorry, this ain't a bug in GDB.
 
The fact that xxgdb, ddd, etc, works fine tells me it's a problem in perl if
anywhere, but more to the point, the way you are going about this is wrong.

 
If you want a tty to communicate with gdb, create a tty and do gdb
--tty="whatever".
 
Don't try to play games with stdin.

If you need something more complex, look at the new MI interface.


Comment 15 Trond Eivind Glomsrxd 2000-08-11 18:52:51 UTC
OK - bug in usage according to one of the GDB develpers (don't use GDB though a
pipe). Closing.


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