Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Mark Kettenis <kettenis@science.uva.nl>
Cc: Michael Snyder <msnyder@cygnus.com>, gdb-patches@sources.redhat.com
Subject: Re: [PATCH]: linux and zombie threads
Date: Wed, 23 May 2001 19:14:00 -0000	[thread overview]
Message-ID: <3B0C6E4B.3B0B@redhat.com> (raw)
In-Reply-To: <s3i8zjol218.fsf@debye.wins.uva.nl>

Mark Kettenis wrote:
> 
> Michael Snyder <msnyder@cygnus.com> writes:
> 
> > Mark -- these changes prepare the way for a libthread_db change
> > that will allow gdb to recognize zombie threads.
> 
> Hmm, what do you mean with zombie threads when you're talking about a
> libthread_db change?
> 
> For clarity, it seems to be two concepts of "zombie" related to
> LinuxThreads.  One is which I would call a "zombie thread", which
> basically is a thread that has exited (by invoking pthread_exit() or
> returning from the, but has not yet been joined.  These are reported
> by libthread_db as TD_THR_ZOMBIE.

Yes.

> The other I would call a "zombie process", which basically is a kernel
> thread that has exited (by invoking _exit()) but has not yet been
> waited for.  These are the ondes reported as TD_THR_UNKNOWN.  Their
> existence is very Linux-specific, and the fact that they tend to show
> up when debugging is related to a kernel bug for which I have been
> unable to find a kernel hacker to fix.

These also show up when a thread has exited and has been
pthread_joined.  I'm sure it's a kernel bug, but without 
these changes, it gets GDB all screwed up.

> 
> > 2001-05-22  Michael Snyder  <msnyder@redhat.com>
> >
> >       * thread-db.c: Allow for defunct zombie threads.
> >       (attach_thread): Do not attempt to attach zombie thread.
> >       (thread_db_thread_alive): Return false for defunct zombie thread.
> >       (find_new_threads_callback): Don't add defunct zombie thread to list.
> 
> That said, I think your patch is OK.  We want GDB to ignore the
> "zombie processes".  Practically all Linux kernels contain the bug
> that creates them, and even if the bug was fixed, there probably is a
> small window where these "zombie processes" are visible.
> 
> Could you clean up your patch a bit before checking it in?  There seem
> to be some whitespace/indentation problems.  And lining up the local
> variables in thread_db_thread_alive() seems to be against the coding
> standards too (since it introduces unnecessary whitespace).
> 
> Mark


      reply	other threads:[~2001-05-23 19:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-22 17:07 Michael Snyder
2001-05-23  4:49 ` Mark Kettenis
2001-05-23 19:14   ` Michael Snyder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B0C6E4B.3B0B@redhat.com \
    --to=msnyder@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@science.uva.nl \
    --cc=msnyder@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox