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 17:16:00 -0000	[thread overview]
Message-ID: <F69D5B35CAB1F043B9EE359EDA4318DC0CF24412@nhc0ex17.goodrich.root.local> (raw)
In-Reply-To: <201109211746.23961.pedro@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 2573 bytes --]

> -----Original Message-----
> From: Pedro Alves [mailto:pedro@codesourcery.com] 
> Sent: Wednesday, September 21, 2011 12:46 PM
> To: Burkhardt, Glenn
> Cc: gdb@sourceware.org
> Subject: Re: fail to attach to process on Solaris
> 
> On Wednesday 21 September 2011 17:18:25, Burkhardt, Glenn wrote:
> > Thank you very much for your response.
> > 
> > I did peek at /proc from the command line when the breakpoint in
> > find_procinfo_or_die() was hit - there was no corresponding 
> LWP.  Nor, 
> > does it seem, that any LWP with the same thread number ever existed.
> > 
> > Here's more extensive info, with a complete stack trace, and some 
> > preliminary info printed after gdb attaches.  This time, the thread 
> > number that triggered the problem was 65.
> 
> Okay.  I assume your program isn't spawning and exiting 
> threads quickly in succession, otherwise, we'd see LWP ids 
> much higher.
> 
> It's libthread_db.so that maps a thread to a LWP id, so we 
> may be missing some state checks and getting back a stale id.
> Try the "maint info sol-threads" command (I never noticed 
> this command before), and let's see what state does 
> libthread_db.so think the thread is in.  I see that 
> linux-thread-db.c (the glibc/linux fork of this code) has 
> extra checks for ignoring threads in some states that the 
> Solaris code doesn't have.
> 
> Please don't top post.  That has a tendency of making one 
> forget to answer questions.  :-)  Here it is again:
> 
> > This is Solaris 9, with the default 1:1 model thread library, right?
> 
> --
> Pedro Alves
> 

So, this time the first thread to fail is #68, and the maint command
shows the thread as having a 'zombie' LWP:

 - Sleep func: 0x6ccfa4
user   thread #67, lwp 67, (active)    startfunc: bootStrap
user   thread #69, lwp 69, (asleep)    startfunc: bootStrap
 - Sleep func: 0x6ccfa4
user   thread #2, lwp 2, (zombie)    startfunc: bootStrap
user   thread #61, lwp 61, (zombie)    startfunc: bootStrap
user   thread #64, lwp 64, (zombie)    startfunc: bootStrap
user   thread #65, lwp 65, (zombie)    startfunc: bootStrap
user   thread #70, lwp 70, (zombie)    startfunc: bootStrap
user   thread #66, lwp 66, (zombie)    startfunc: bootStrap
user   thread #68, lwp 68, (zombie)    startfunc: bootStrap
(gdb) c
Continuing.
procfs: couldn't find pid 16946 (kernel thread 68) in procinfo list.
(gdb) det
Detaching from program:
/home/glenn.burkhardt/targets/sol/ata0a/rms/rms.sparc, process 16946


A complete log of the session is attached.

[-- Attachment #2: gdb.log --]
[-- Type: application/octet-stream, Size: 8192 bytes --]

  reply	other threads:[~2011-09-21 17:16 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 [this message]
2011-09-21 17:39             ` Pedro Alves
2011-09-21 18:38               ` Burkhardt, Glenn
2011-09-21 18:45               ` Burkhardt, Glenn
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=F69D5B35CAB1F043B9EE359EDA4318DC0CF24412@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).