This is the mail archive of the
mailing list for the GDB project.
Re: Patch: fix gdb_gcore.sh failure in ash/dash
On Sun, Sep 11, 2005 at 11:18:56PM +0200, Mark Kettenis wrote:
> > Date: Fri, 09 Sep 2005 19:11:13 -0700
> > From: Qunying Pan <firstname.lastname@example.org>
> > Hi,
> > Running gdb_gcore.sh in ash/dash fails with message "Hangup detected on
> > fd 0". The following patch fixes the problem. Acceptable?
> This seems like a bug in ash/dash (whatever that is). Why isn't your
> /bin/sh not a proper bourne shell?
> I'm not inclined to apply this patch just because people link /bin/sh
> to some random piece of crap. So I'd like to see somewhat more
It's perfectly legitimate behavior, as far as I can tell - it depends
how long the shell keeps the pipe open and whether it uses a tempfile.
IIRC bash will prefer to use a tempfile and ash will pipe? Not sure.
GDB detects the SIGHUP before it writes out the coredump.
Try this, in either ash or bash:
printf 'printf "hi\\n"\nquit\n' | gdb
Neither shell's going to give you a printf, just a hangup message.