Re: [PATCH] exec: log when wait_for_dump_helpers aborts due to a signal

From: scott
Date: Thu Oct 27 2011 - 13:44:21 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/