public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Burkhardt, Glenn" <Glenn.Burkhardt@goodrich.com>
To: "Pedro Alves" <pedro@codesourcery.com>
Cc: <gdb@sourceware.org>
Subject: RE: fail to attach to process on Solaris
Date: Wed, 21 Sep 2011 18:45:00 -0000	[thread overview]
Message-ID: <F69D5B35CAB1F043B9EE359EDA4318DC0CF2472D@nhc0ex17.goodrich.root.local> (raw)
In-Reply-To: <201109211839.28701.pedro@codesourcery.com>

> -----Original Message-----
> From: Pedro Alves [mailto:pedro@codesourcery.com] 
> Sent: Wednesday, September 21, 2011 1:39 PM
> To: Burkhardt, Glenn
> Cc: gdb@sourceware.org
> Subject: Re: fail to attach to process on Solaris
> 
> 
> Okay, the linux code ignores zombie threads, like in the 
> patch below.  Does that help?  There's a couple more places 
> where it ignores zombie threads, that we may need to bring 
> over as well.
> Look for TD_THR_ZOMBIE in linux-thread-db.c.
> 
> --
> Pedro Alves
> 
> ---
>  gdb/sol-thread.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> Index: src/gdb/sol-thread.c
> ===================================================================
> --- src.orig/gdb/sol-thread.c	2011-03-01 16:00:06.000000000 +0000
> +++ src/gdb/sol-thread.c	2011-09-21 18:34:30.029928904 +0100
> @@ -1177,6 +1177,9 @@ sol_find_new_threads_callback (const td_
>    if (retval != TD_OK)
>      return -1;
>  
> +  if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
> +    return 0;			/* A zombie -- ignore.  */
> +
>    ptid = BUILD_THREAD (ti.ti_tid, PIDGET (inferior_ptid));
>    if (!in_thread_list (ptid) || is_exited (ptid))
>      add_thread (ptid);
> 

The patch makes a big difference.  At least, I can continue the attached
process now.  I'll play with it a bit more, and report back.  I'll also
check for other places where
TD_THR_ZOMBIE in linux-thread-db.c is used.

  parent reply	other threads:[~2011-09-21 18:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 15:05 Burkhardt, Glenn
2011-09-02 21:24 ` Pedro Alves
2011-09-20 23:22   ` Burkhardt, Glenn
2011-09-21 14:26     ` Pedro Alves
2011-09-21 16:19       ` Burkhardt, Glenn
2011-09-21 16:46         ` Pedro Alves
2011-09-21 17:16           ` Burkhardt, Glenn
2011-09-21 17:39             ` Pedro Alves
2011-09-21 18:38               ` Burkhardt, Glenn
2011-09-21 18:45               ` Burkhardt, Glenn [this message]
2011-09-21 16:28       ` Burkhardt, Glenn
2011-09-22 13:13 Burkhardt, Glenn

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=F69D5B35CAB1F043B9EE359EDA4318DC0CF2472D@nhc0ex17.goodrich.root.local \
    --to=glenn.burkhardt@goodrich.com \
    --cc=gdb@sourceware.org \
    --cc=pedro@codesourcery.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).