linux-thread-db.c not only caller of add_thread, -> gdb segv
Daniel Jacobowitz
drow@false.org
Fri Nov 9 14:02:00 GMT 2007
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
More information about the Gdb
mailing list