This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: linux-thread-db.c not only caller of add_thread, -> gdb segv


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]