Subj : Re: pthread_mutex_lock throws an exception on receiving signal 15 To : comp.programming.threads From : pankaj-startup Date : Thu Oct 13 2005 12:52 am It seems problem is solved now. In original code SIGTERM was blocked and then sigwait was called to handle async-signals in synchronous manner. for more details: http://www.awprofessional.com/content/images/0201633922/sourcecode/sigwait.c So there were not an issue of calling unsafe functions from the context of async signal-handler. My signal-handler was cancelling 2 threads before calling exit(0). I just replaced exit(0) by _exit(0). And problem appears to be disappeared (process never dumped the core). I think this resolution has following logical reason. In the child branch of a fork(), it is normally incorrect to use exit(), because that can lead to stdio buffers being flushed twice, and temporary files being unexpectedly removed. In C++ code the situation is worse, because destructors for static objects may be run incorrectly. http://www.erlenstar.demon.co.uk/unix/faq_2.html dynamic loader must be calling fork/exec to create a process. In that sense my process can be a child process. But if this is the case, then it would be always dangeourous to call exit in C++ multithreaded application. .