This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: linux-thread-db.c not only caller of add_thread, -> gdb segv
- From: Daniel Jacobowitz <drow at false dot org>
- To: Douglas Evans <dje at google dot com>
- Cc: gdb at sourceware dot org
- Date: Fri, 9 Nov 2007 09:02:25 -0500
- Subject: Re: linux-thread-db.c not only caller of add_thread, -> gdb segv
- References: <e394668d0711082038r412087eaj3b0cda56cdddaff0@mail.gmail.com>
On Thu, Nov 08, 2007 at 08:38:13PM -0800, Douglas Evans wrote:
> Hi. I'm trying to decide what's the best way to fix a bug I've found.
> linux-thread-db.c is not the only caller of add_thread, e.g. infrun.c
> calls it too.
This is true. But if you're using the Linux native target, and reach
the point where any of the other add_thread calls are made, then
there's already a bug. It is supposed to detect all new threads.
It sort of has to - that's how infrun gets the new ptid_t.
> I can see two solutions
> 1) ensure all calls to add_thread properly initialize thread_info.private
> (via callback or whatever)
> 2) have linux-thread-db.c always check thread_info.private before
> dereferencing it.
3) Figure out how you got to any of the other add_thread calls.
--
Daniel Jacobowitz
CodeSourcery