Re: main thread pthread_exit/sys_exit bug!

From: Roland McGrath
Date: Thu Feb 05 2009 - 16:32:54 EST


> Yes we have the bug, and wait_task_stopped() should be fixed. But it is
> buggy anyway, even if we delay the death of the main thread. But I also
> think we shouldn't.

Sorry, I'd missed the actual bug report among all the tangential verbiage.
I wrote this test case for it. Is there any problem other than this one?


Thanks,
Roland

==========

#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <pthread.h>
#include <assert.h>

static void *
thfunc (void *arg)
{
sleep (2);
puts ("stopping");
raise (SIGSTOP);
puts ("resumed");
exit (0);
}

int
main (void)
{
pthread_t th;
int rc = pthread_create (&th, NULL, &thfunc, NULL);
assert_perror (rc);
pthread_exit (0);
/*NOTREACHED*/
return 1;
}
--
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/