Philippe Waroquiers d208bc934b Fix 372504 Hanging on exit_group
Note that it is unclear if the PRE syscall for rt_sigsuspend
is properly setting up a temporary mask in the thread state
tmp_sig_mask:  if an handler is called while a thread is
calling sigsuspend, the mask during the handler run must be
the temporary mask set by sigsuspend.
It is not clear if/where the valgrind sigframe builder/handler
sets the tmp_sig_mask to the value as expected by the user
(i.e. the value of the temporary mask which was given to
the sigsuspend syscall)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16141
2016-11-19 14:54:44 +00:00

25 lines
408 B
C

#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
static void* t_fn(void* v)
{
sigset_t mask;
sigfillset(&mask);
sigsuspend(&mask);
return NULL;
}
int main (int argc, char *argv[])
{
pthread_t t1;
pthread_create(&t1, NULL, t_fn, NULL);
sleep(1); // Should be enough to have the thread in sigsuspend
// printf("dying\n");
exit(0);
}