Subj : Re: lwp_mutex_lock hang? To : comp.programming.threads From : roger.faulkner Date : Tue Mar 22 2005 09:22 pm Johan Piculell wrote: > Hi. > I have a strange lockup problem in our application that I just cannot > understand. We have only experienced this at one customer and not been able > to reproduce so far. Problem seems to occur several times per week however, > and it hangs on a shared memory mutex in several threads: > [snip] > > The reason for having a shared mutex is because we can parallelize using > threads and/or processes, but I cannot see any reference to f9800000 in any > other process either and not even a lwp_mutex_lock. > The hardware they are running on is a Sunfire 6800 with Solaris 8. We are > linking with the alternate thread library (/usr/lib/lwp), not sure about the > patch status but can easily be checked. > > Even if we have messed something up in our code (which usually is the case > :-( ), is it really possible to have 3 threads in lwp_mutex_lock() on the > same mutex? Yes, if the original owner thread (or process containing the thread) terminated while it was still holding the lock. Also, the shared memory need not be mapped to the same address in all of your processes. You need to attach a debugger to the wedged process and examine the contents of the mutex at f9800000. See the declaration of lwp_mutex_t in /usr/include/sys/synch.h. Roger Faulkner Sun Microsystems .