Oleg Nesterov 5c99cbf49a coredump: set ->group_exit_code for other CLONE_VM tasks too
User visible change.

do_coredump() kills all threads which share the same ->mm but only the
coredumping process gets the proper exit_code.  Other tasks which share
the same ->mm die "silently" and return status == 0 to parent.

This is historical behaviour, not actually a bug.  But I think Frank
Heckenbach rightly dislikes the current behaviour.  Simple test-case:

	#include <stdio.h>
	#include <unistd.h>
	#include <signal.h>
	#include <sys/wait.h>

	int main(void)
	{
		int stat;

		if (!fork()) {
			if (!vfork())
				kill(getpid(), SIGQUIT);
		}

		wait(&stat);
		printf("stat=%x\n", stat);
		return 0;
	}

Before this patch it prints "stat=0" despite the fact the child was killed
by SIGQUIT.  After this patch the output is "stat=3" which obviously makes
more sense.

Even with this patch, only the task which originates the coredumping gets
"|= 0x80" if the core was actually dumped, but at least the coredumping
signal is visible to do_wait/etc.

Reported-by: Frank Heckenbach <f.heckenbach@fh-soft.de>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-03-06 11:26:46 -08:00
..
2010-02-07 03:06:21 -05:00
2010-01-14 09:05:42 -05:00
2010-02-26 12:15:54 -06:00
2010-01-19 22:36:06 -06:00
2009-06-17 00:36:36 -04:00
2009-07-12 12:22:34 -07:00
2010-02-19 03:35:12 -05:00
2010-01-11 14:30:09 +01:00
2009-12-16 07:20:18 -08:00
2010-01-26 22:22:26 -05:00
2009-12-16 07:20:13 -08:00
2009-12-22 12:27:34 -05:00
2010-03-06 11:26:29 -08:00
2010-03-06 11:26:29 -08:00
2009-09-24 07:21:03 -07:00
2010-03-03 14:13:08 -05:00
2009-12-17 04:52:13 -05:00
2010-03-06 11:26:29 -08:00
2010-03-06 11:26:29 -08:00
2010-03-03 14:07:59 -05:00
2009-12-17 10:51:40 -05:00
2010-03-06 11:26:29 -08:00
2010-03-03 14:08:00 -05:00
2009-12-16 12:16:49 -05:00