public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: GDB hangs with simple multi-threaded program on linux
Date: Thu, 15 Jul 2010 22:22:00 -0000	[thread overview]
Message-ID: <1279232541.14577.41.camel@hactar> (raw)
In-Reply-To: <m3bpa8lh4f.fsf@fleche.redhat.com>

On Thu, 2010-07-15 at 12:44 -0600, Tom Tromey wrote:
> >>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:
> 
> Thiago> I'm struggling with an issue which perhaps you already faced or
> Thiago> thought about...
> 
> I asked around about this, and it turns out that we have a patch in the
> Fedora SRPM for it.

Thanks for looking into it!

> The approach in this patch seems to be racy.  Roland says we can do
> better if we enable exit tracing.  I see this in linux-nat.c:
> 
>   /* Do not enable PTRACE_O_TRACEEXIT until GDB is more prepared to support
>      read-only process state.  */
> 
> I wonder what that means :-)

I will play with that option and see what happens...

Thanks for sending the patch. It is racy but at least makes an effort to
avoid the trap, which is an improvement. :-)

> Thiago> 1. Is it true that when the main thread exits but there are other
> Thiago> threads in the thread group, then no SIGCHLD is generated to notify GDB
> Thiago> that it exited (perhaps because such a SIGCHLD could be ambiguous and
> Thiago> mean that the whole process exited)?
> 
> Yes, Roland said that no SIGCHLD is generated.

Bummer.

> Thiago> 2. Is there a way for GDB to wait on just the main thread instead of on
> Thiago> the whole process when it waits on a TID which is also the PID?
> 
> I guess not.

Ouch. Looks like we have our hands tied here. :-/

> BTW, if you plan to work on this, it is also PR 10970.

I do, and will update the PR accordingly. Thanks!
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center

  parent reply	other threads:[~2010-07-15 22:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-15 15:46 Thiago Jung Bauermann
2010-07-15 18:44 ` Tom Tromey
2010-07-15 18:47   ` Tom Tromey
2010-07-15 22:22   ` Thiago Jung Bauermann [this message]
2010-07-16 15:58   ` Daniel Jacobowitz

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=1279232541.14577.41.camel@hactar \
    --to=bauerman@br.ibm.com \
    --cc=gdb@sourceware.org \
    --cc=tromey@redhat.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).