From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>, Doug Evans <dje@google.com>
Subject: Re: [patch] Workaround for 10970, 12702, avoid calling waitpid
Date: Wed, 18 May 2011 18:17:00 -0000 [thread overview]
Message-ID: <201105181916.59767.pedro@codesourcery.com> (raw)
In-Reply-To: <20110518171311.GA13277@host1.jankratochvil.net>
On Wednesday 18 May 2011 18:13:11, Jan Kratochvil wrote:
> + if (is_lwp (lp->ptid) && GET_PID (lp->ptid) == GET_LWP (lp->ptid)
> + && linux_lwp_is_zombie (GET_LWP (lp->ptid)))
When can is_lwp(lp->ptid) be false?
> + if (pid != 0 && (pid == -1 && errno == ECHILD))
pid != 0 check looks redundant as is. Is it there to
try to make this more readable? IMO, it isn't because
whenever I read this, I'll stop and ponder whether
there's a bug here, due to the redundancy. :-)
FWIW, this looks good to me, but I wonder whether
checking for zombieness after the waitpids wouldn't
avoid a few /proc/ reads in the common case.
The inferior exit code reported to the core/user will be the
exit code of the last LWP that exits, instead of the
leader's exit code. We've stepped out of C realm when
the leader exited, so I'm not sure that matters (or how
to make it be != 0, even).
--
Pedro Alves
next prev parent reply other threads:[~2011-05-18 18:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 18:19 Doug Evans
2011-05-17 22:08 ` Jan Kratochvil
2011-05-18 17:13 ` Jan Kratochvil
2011-05-18 18:17 ` Pedro Alves [this message]
2011-05-18 18:53 ` Jan Kratochvil
2011-05-18 19:17 ` Pedro Alves
2011-05-18 19:32 ` Jan Kratochvil
2011-05-18 19:53 ` Pedro Alves
2011-05-18 22:21 ` Doug Evans
2011-05-27 17:04 ` Jan Kratochvil
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=201105181916.59767.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@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