This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: Re: [patch] Fix for 'info threads' crashes if zombie threads exist
- From: Daniel Jacobowitz <drow at false dot org>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: lace at jankratochvil dot net, gdb-patches at sourceware dot org, bartoschek at or dot uni-bonn dot de
- Date: Thu, 13 Jul 2006 15:47:31 -0400
- Subject: Re: RFC: Re: [patch] Fix for 'info threads' crashes if zombie threads exist
- References: <20060620130932.GA21490@nevyn.them.org> <200606201524.45099.bartoschek@or.uni-bonn.de> <20060620132737.GA21951@nevyn.them.org> <20060619165609.GA14691@host0.dyn.jankratochvil.net> <20060620170451.GA17022@host0.dyn.jankratochvil.net> <20060620171109.GA28310@nevyn.them.org> <20060620185326.GA9482@host0.dyn.jankratochvil.net> <20060620190740.GA31643@nevyn.them.org> <20060713040135.GY24622@nevyn.them.org> <200607131849.k6DInqeJ029991@elgar.sibelius.xs4all.nl>
On Thu, Jul 13, 2006 at 08:49:52PM +0200, Mark Kettenis wrote:
> Probably a good idea, given the fact that it's unlikely we'll see a
> N:M threads library on Linux is the near future.
Exactly. I've already removed functional M:N support in the interest
of improving the 1:1 support we're actually using; these are some of
the remaining vestigal bits.
> > It also (long overdue) removes the dependence on fill_gregset, and
> > removes a not especially useful call into libthread_db for converting
> > threads to strings. There are a number of more possible cleanups,
> > but this hits the big ones.
>
> Doesn't your simplification of thread_db_pid_to_str() lose some useful
> information about the extra system thread that the LinuxThreads
> library used to have (I'm not sure if that wart is still present in
> NPTL)?
It's not still present in NPTL.
It doesn't actually lose anything about the manager thread, because we
were never providing any in the first place. We were only checking the
thread state, and the manager would always be TD_THR_ACTIVE. That was
really only useful on platforms which did use the other states, like
STOPPED and SLEEP, but LinuxThreads didn't.
Such information might have been handy - but we don't have any reliable
way to identify the manager thread :-(
> You might want to look at implementing to_extra_thread_info() to give
> some state information; see bsd-uthread.c for an example.
... and in any case that's a better place for the state information.
Nice. Unfortunately we don't really have useful state bits. I could
probably move the exiting/missing text there. I'll keep that in mind
for a future update, thanks!
--
Daniel Jacobowitz
CodeSourcery