From: scott@netsplit.com
To: fa.linux.kernel@googlegroups.com
Cc: Mandeep Singh Baines <msb@chromium.org>,
linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Neil Horman <nhorman@tuxdriver.com>,
Earl Chew <earl_chew@agilent.com>,
Andi Kleen <andi@firstfloor.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] exec: log when wait_for_dump_helpers aborts due to a signal
Date: Thu, 27 Oct 2011 10:31:30 -0700 (PDT) [thread overview]
Message-ID: <22032480.316.1319736691009.JavaMail.geo-discussion-forums@prgt10> (raw)
In-Reply-To: <fa.sHib65lEoXP9G43lrndbDfam4CU@ifi.uio.no>
I wonder whether we could use a slightly different approach for this loop.
In the current code in the case where there is a signal pending on the crashing process (in our case it looks like it's SIGTERM as a result of the process group being killed) we never call pipe_wait() at all. This means everything is certainly missing from /proc if the crashing process is reaped before crash-reporter gets a look-in.
What would be the side-effect of changing the code such that we call pipe_wait() at least once in this scenario, for example:
diff --git a/fs/exec.c b/fs/exec.c
index 25dcbe5..8959d304 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -2030,11 +2030,11 @@ static void wait_for_dump_helpers(struct file *file)
pipe->readers++;
pipe->writers--;
- while ((pipe->readers > 1) && (!signal_pending(current))) {
+ do {
wake_up_interruptible_sync(&pipe->wait);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
pipe_wait(pipe);
- }
+ } while ((pipe->readers > 1) && (!signal_pending(current)));
pipe->readers--;
pipe->writers++;
This way around would it not at least wait for the core_pattern user mode helper to call read() at least once before bailing out due to signal?
Scott
next parent reply other threads:[~2011-10-27 17:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.DU5J+vcQ1k3A34VvvU/+Dois5+Y@ifi.uio.no>
[not found] ` <fa.sHib65lEoXP9G43lrndbDfam4CU@ifi.uio.no>
2011-10-27 17:31 ` scott [this message]
2011-10-26 1:07 Mandeep Singh Baines
2011-10-26 1:24 ` Mandeep Singh Baines
2011-10-26 16:54 ` Oleg Nesterov
2011-10-28 23:26 ` Andrew Morton
2011-10-29 12:42 ` Neil Horman
2011-10-29 14:43 ` Oleg Nesterov
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=22032480.316.1319736691009.JavaMail.geo-discussion-forums@prgt10 \
--to=scott@netsplit.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andi@firstfloor.org \
--cc=earl_chew@agilent.com \
--cc=fa.linux.kernel@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=msb@chromium.org \
--cc=nhorman@tuxdriver.com \
--cc=viro@zeniv.linux.org.uk \
/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
Powered by JetHome