This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA [threads]: Fix print-threads.exp
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 14 Jan 2003 18:59:22 -0500
- Subject: Re: RFA [threads]: Fix print-threads.exp
- References: <20030110210215.GA7952@nevyn.them.org>
On Fri, Jan 10, 2003 at 04:02:15PM -0500, Daniel Jacobowitz wrote:
> As you could tell from earlier messages, this bug is somewhat gross...
>
> Basically, at one point in the process of exiting a thread (in LinuxThreads,
> this is) sets its own p_terminated flag. After that, libthread_db reports
> it as a zombie and refuses to do certain things with it. But the LWP is
> really still there, and we still need to handle it, even if the "thread" is
> logically gone.
>
> The reason print-threads.exp triggered this problem is because of a
> breakpoint on kill (); kill is used in the thread's exit path. I think
> breakpointing kill is a reasonable thing to do, so I'd like this to work.
>
> The only thing we can do is detect this case [if map_id2thr calls, we
> iterate over threads looking for zombies], and handle that thread like an
> LWP instead of querying libthread_db about it. This works just fine, and
> fixes print-threads.exp. It also fixes schedlock.exp in my last couple of
> tests, but I'm betting that's just random. I'll get back to making
> schedlock.exp less flaky next week.
>
> Is this OK? Does anyone have any better ideas? Yes, I imagine I could fix
> this more easily by fixing the system's threads library, but for obvious
> reasons I'd rather GDB coped.
This patch is withdrawn. As per Mark's suggestion, I'm going to start
using TD_DEATH instead. That should make this much easier, although
not necessarily less gross.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer