From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis To: "Glenn F. Maynard" Cc: gdb@sourceware.cygnus.com Subject: Re: gdb: detection and/or fork+gethostbyname crash workaround? Date: Tue, 24 Jul 2001 13:54:00 -0000 Message-id: References: <20010723210115.B1359@zewt.org> <1010724155219.ZM20181@ocotillo.lan> <20010724142248.A2923@zewt.org> X-SW-Source: 2001-07/msg00349.html "Glenn F. Maynard" writes: > > I searched gdb@sources.redhat.com w/ both of these search phrases and > > only came up with the message to which I'm responding. Can you provide > > some URLs for the archived messages? > > http://sources.redhat.com/ml/bug-glibc/2000-04/msg00018.html > http://sources.redhat.com/ml/bug-gdb/2001-03/msg00049.html > > (the first is more useful; it was apparently CC'd to both > bug-glibc and bug-gdb, but that's what google turned up.) Hmm, I'd expect a Trace/breakpoint trap... Yup, that's what I get. What's happening is that when you fork, GDB has its breakpoints inserted in the inferior. Therefore the child inherits those breakpoints from its parents. When it trips such a breakpoint, it gets killed since the child isn't traced by GDB. In this particular case it's a GDB-internal solib_event breakpoint that gets tripped, since gethostbyname() causes one or more NSS modules to be loaded. It's not easy to solve this (and I suspect that a lot of platforms suffer from the same problems). Implementing the follow-fork stuff for Linux would probably do the trick. Perhaps I can find some time to implement that, but it won't be ready for the next release. Mark