diff options
author | Oleg Nesterov | 2008-03-02 19:44:44 +0100 |
---|---|---|
committer | Linus Torvalds | 2008-03-03 23:53:16 +0100 |
commit | 821c7de7194e77afee1a69d50830a329a6d9af9f (patch) | |
tree | 6755cb5f57822c142b228ad8ca817c18b8f31884 /arch/x86/lguest | |
parent | will_become_orphaned_pgrp: partially fix insufficient ->exit_state check (diff) | |
download | kernel-qcow2-linux-821c7de7194e77afee1a69d50830a329a6d9af9f.tar.gz kernel-qcow2-linux-821c7de7194e77afee1a69d50830a329a6d9af9f.tar.xz kernel-qcow2-linux-821c7de7194e77afee1a69d50830a329a6d9af9f.zip |
exit_notify: fix kill_orphaned_pgrp() usage with mt exit
1. exit_notify() always calls kill_orphaned_pgrp(). This is wrong, we
should do this only when the whole process exits.
2. exit_notify() uses "current" as "ignored_task", obviously wrong.
Use ->group_leader instead.
Test case:
void hup(int sig)
{
printf("HUP received\n");
}
void *tfunc(void *arg)
{
sleep(2);
printf("sub-thread exited\n");
return NULL;
}
int main(int argc, char *argv[])
{
if (!fork()) {
signal(SIGHUP, hup);
kill(getpid(), SIGSTOP);
exit(0);
}
pthread_t thr;
pthread_create(&thr, NULL, tfunc, NULL);
sleep(1);
printf("main thread exited\n");
syscall(__NR_exit, 0);
return 0;
}
output:
main thread exited
HUP received
Hangup
With this patch the output is:
main thread exited
sub-thread exited
HUP received
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/lguest')
0 files changed, 0 insertions, 0 deletions