Re: segfault with pthread and detached attribute

2005-08-06 Thread Corinna Vinschen
On Aug 6 15:45, Samuel Thibault wrote: > Hi, > > I had strange hangs and segfaults with a program, and it happens that > detached thread termination may segfault: > [...] > Adding a Sleep(1000); in the f() function before returning prevents from > the crash, so I guess f() returning fast triggers

segfault with pthread and detached attribute

2005-08-06 Thread Samuel Thibault
Hi, I had strange hangs and segfaults with a program, and it happens that detached thread termination may segfault: #include #include #include void *f(void *foo) { return(NULL); } pthread_t t; pthread_attr_t attr; int main(void) { if (pthread_attr_init(&attr))