[M3devel] [M3commit] CVS Update: cm3

Tony Hosking hosking at cs.purdue.edu
Thu Jan 13 06:56:27 CET 2011


In this trace, there are only a few threads not trying to acquire heapMu for allocation.
I don't know what the spin_lock threads are doing...
We're left with thread 39 stuck in some spin lock.
Thread 35 is stuck in fork (in AtForkPrepare) waiting for heapMu.
Thread 31 is stuck in InitMutex trying waiting for heapMu.
I can't see any thread that actually holds heapMu.

Except, now I see that RTCollector also has AtFork routines, which LockHeap/UnlockHeap.
I think this means the atfork routines in ThreadPThread must invoke LockHeap/UnlockHeap to avoid deadlocking with itself!  Yikes.
I'll check in the change and perhaps you can see if that fixes things.

Antony Hosking | Associate Professor | Computer Science | Purdue University
305 N. University Street | West Lafayette | IN 47907 | USA
Office +1 765 494 6001 | Mobile +1 765 427 5484




On Jan 12, 2011, at 10:24 PM, Mika Nystrom wrote:
> 
> Tony Hosking writes:
>> OK, backing right off.  Try the latest.
> 
> Hmm, think we're deadlocked again?
> 
> My application goes catatonic almost right away, but the trace below is
> from the threadtest program.
> 
> 
> Continuing.
> 
> Program received signal SIGINT, Interrupt.
> 0x9710b136 in semaphore_wait_trap ()

...

> Thread 67 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 66 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 65 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 64 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 63 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 62 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 61 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 60 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 59 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 58 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 57 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 56 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 55 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 54 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 53 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 52 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 51 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 50 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 49 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 48 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 47 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 46 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 45 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 44 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 43 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 42 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 41 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 40 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 39 (process 86373):
> #0  0xffff0279 in __spin_lock ()
> #1  0x97137203 in _cthread_fork_prepare ()
> #2  0x97137155 in fork ()
> #3  0x00007a21 in ProcessPosixCommon__Create_ForkExec (cmd=0x64334, params=0x64344, env=0x0, wd=0x0, stdin=0x0, stdout=0x0, stderr=0x0) at ../src/os/POSIX/ProcessPosixCommon.m3:75
> #4  0x00008f0b in Process__Create (cmd=0x64334, params=0x64344, env=0x0, wd=0x0, stdin=0x0, stdout=0x0, stderr=0x0) at ../src/os/POSIX/ProcessPosix.m3:21
> #5  0x0000329e in Main__FApply (cl=0xb05bc0) at ../src/Main.m3:56
> #6  0x00041068 in ThreadPThread__RunThread (me=0xe018c0) at ../src/thread/PTHREAD/ThreadPThread.m3:450
> #7  0x00040d97 in ThreadPThread__ThreadBase (param=0xe018c0) at ../src/thread/PTHREAD/ThreadPThread.m3:422
> #8  0x9713885d in _pthread_start ()
> #9  0x971386e2 in thread_start ()
> 
> Thread 38 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 37 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 36 (process 86373):
> #0  0xffff028f in __spin_lock ()
> #1  0x00000000 in ?? ()
> 
> Thread 35 (process 86373):
> #0  0x9710b142 in semaphore_wait_signal_trap ()
> #1  0x97110c46 in pthread_mutex_lock ()
> #2  0x00044929 in ThreadPThread__pthread_mutex_lock (i=0x7e920) at ../src/thread/PTHREAD/ThreadPThreadC.c:462
> #3  0x000436d2 in ThreadPThread__PThreadLockMutex (mutex=0x7e920, line=1274) at ../src/thread/PTHREAD/ThreadPThread.m3:1253
> #4  0x000437b1 in ThreadPThread__AtForkPrepare () at ../src/thread/PTHREAD/ThreadPThread.m3:1274
> #5  0x97137217 in _cthread_fork_prepare ()
> #6  0x97137155 in fork ()
> #7  0x00007a21 in ProcessPosixCommon__Create_ForkExec (cmd=0x64334, params=0x64344, env=0x0, wd=0x0, stdin=0x0, stdout=0x0, stderr=0x0) at ../src/os/POSIX/ProcessPosixCommon.m3:75
> #8  0x00008f0b in Process__Create (cmd=0x64334, params=0x64344, env=0x0, wd=0x0, stdin=0x0, stdout=0x0, stderr=0x0) at ../src/os/POSIX/ProcessPosix.m3:21
> #9  0x0000329e in Main__FApply (cl=0xb05ae0) at ../src/Main.m3:56
> #10 0x00041068 in ThreadPThread__RunThread (me=0xe01600) at ../src/thread/PTHREAD/ThreadPThread.m3:450
> #11 0x00040d97 in ThreadPThread__ThreadBase (param=0xe01600) at ../src/thread/PTHREAD/ThreadPThread.m3:422
> #12 0x9713885d in _pthread_start ()
> #13 0x971386e2 in thread_start ()
> 
> Thread 31 (process 86373):
> #0  0x9710b136 in semaphore_wait_trap ()
> #1  0x97110c53 in pthread_mutex_lock ()
> #2  0x00044929 in ThreadPThread__pthread_mutex_lock (i=0x7e920) at ../src/thread/PTHREAD/ThreadPThreadC.c:462
> #3  0x00043bc4 in RTOS__LockHeap () at ../src/thread/PTHREAD/ThreadPThread.m3:1332
> #4  0x0003f2e6 in ThreadPThread__InitMutex (m=0x2070010, root=0x207000c, Clean=0x3f1b6) at ../src/thread/PTHREAD/ThreadPThread.m3:101
> #5  0x0003f38f in ThreadPThread__LockMutex (m=0x207000c) at ../src/thread/PTHREAD/ThreadPThread.m3:117
> #6  0x000091e8 in Rd__GetChar (rd=0x207000c) at ../src/rw/Rd.m3:33
> #7  0x0000314d in Main__RApply (cl=0xb05a00) at ../src/Main.m3:42
> #8  0x00041068 in ThreadPThread__RunThread (me=0xe01340) at ../src/thread/PTHREAD/ThreadPThread.m3:450
> #9  0x00040d97 in ThreadPThread__ThreadBase (param=0xe01340) at ../src/thread/PTHREAD/ThreadPThread.m3:422
> #10 0x9713885d in _pthread_start ()
> #11 0x971386e2 in thread_start ()




More information about the M3devel mailing list