Subj : Re: pthread_mutex_lock throws an exception on receiving signal 15 To : comp.programming.threads From : Paul Pluzhnikov Date : Wed Sep 21 2005 08:40 am "pankaj-startup" writes: > When application receives signal 15, some thread/code throws exception > (i could not find exact location of this code, even using gdb). Did you try setting a breakpoint on __DoThrow() ? > This exception is catched in main thread. It is extremely unlikely that *that* is what's happening, because exceptions propagate up the stack, and each thread has a separate stack. > On catch, when application tries > to log a message in log file, it tries to acquire a mutex by callling > pthread_mutex_lock. Properly handling async signals in a multithreaded program is quite difficult and best avoided. Attempting to lock a mutex in an async-signal context is definitely not a good idea. > What are thr possible causes to make pthread_mutex_lock throw > exception? pthread_mutex_lock() did *not* (and can't possibly -- it's written in plain C) throw an exception. Your PthreadMutex::lock() did, probably because pthread_mutex_lock() failed. The error code from the latter may provide additional clues. > As per my knowledge, gdb doesn't show status of all threds, am i rt? No, you are wrng. Newer versions of gdb know how to display all threads on AIX. Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. .