Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@freebsd.org>
To: vd@freebsd.org
Cc: Luis Machado <lgustavo@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] PR threads/20743: Don't attempt to suspend or resume exited threads.
Date: Wed, 28 Dec 2016 17:37:00 -0000	[thread overview]
Message-ID: <1700771.1OUYESxIQe@ralph.baldwin.cx> (raw)
In-Reply-To: <20161228080707.GA4007@nitro>

On Wednesday, December 28, 2016 09:07:07 AM Vasil Dimov wrote:
> On Tue, Dec 27, 2016 at 13:03:27 -0800, John Baldwin wrote:
> [...]
> > I have tried changing fbsd_wait() to return a TARGET_WAITKIND_SPURIOUS
> > instead of explicitly continuing the process, but that doesn't help, and it
> > means that the ptid being returned is still T1 in that case.
> > 
> > I'm not sure if I should explicitly be calling delete_exited_threads() in
> > fbsd_resume() before calling iterate_threads()?  Alternatively, fbsd_resume()
> > could use ALL_NONEXITED_THREADS() instead of iterate_threads() (it isn't
> > clear to me which of these is preferred since both are in use).
> > 
> > I added the assertion for my own sanity.  I suspect gdb should never try to
> > invoke target_resume() with a ptid of an exited thread, but if for some
> > reason it did the effect on FreeBSD would be a hang since we would suspend
> > all the other threads and when the process was continued via PT_CONTINUE it
> > would have nothing to do and would never return from wait().  I'd rather have
> > gdb fail an assertion in that case rather than hang.
> [...]
> 
> Hi,
> 
> I am not sure if this is related, but since I get a hang I would rather
> mention it: with the John's patch (including the assert) gdb does not
> emit the "ptrace: No such process" error, but when I attempt to quit,
> it hangs:

No, this is a separate bug in the kernel whereby a process doesn't
treat PT_KILL as a detach-like event but incorrectly expects to keep
getting PT_CONTINUE events for a while until it finally exits.  I'm
working on writing up regression/unit tests for PT_KILL and then
fixing the bug.

-- 
John Baldwin


  reply	other threads:[~2016-12-28 17:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-23 21:30 John Baldwin
2016-12-23 21:43 ` Luis Machado
2016-12-27 16:43   ` Vasil Dimov
2016-12-27 21:03     ` John Baldwin
2016-12-28  8:07       ` Vasil Dimov
2016-12-28 17:37         ` John Baldwin [this message]
2017-01-12 16:29           ` Luis Machado
2017-01-12 19:17             ` John Baldwin
2017-01-13  1:27               ` Luis Machado
2017-01-13  1:53                 ` John Baldwin
2017-01-19 11:54                   ` Pedro Alves
2017-01-06 19:35       ` John Baldwin
2017-01-19 11:56       ` Pedro Alves

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=1700771.1OUYESxIQe@ralph.baldwin.cx \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=lgustavo@codesourcery.com \
    --cc=vd@freebsd.org \
    /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