[M3devel] thread test (Mika)

Dragiša Durić dragisha at m3w.org
Fri Apr 27 20:13:20 CEST 2012


This particular deadlock/fix is observed and fixed for AMD64_LINUX. First change is just because it is same pattern. I ddidn't check if that code is used at all. Second change is our fix.

With this, Mika's threadtest -tests alloc works. This is very probably fix for lots of situations tripped by his test and also for applications with heavy heap usage. 

dd

p.s.  Olaf/Michael, please teach me (again) how to commit this . It was long time since I commited anything to CVS :).

Index: src/thread/PTHREAD/ThreadPThread.m3
===================================================================
RCS file: /usr/cvs/cm3/m3-libs/m3core/src/thread/PTHREAD/ThreadPThread.m3,v
retrieving revision 1.259
diff -U 2 -r1.259 ThreadPThread.m3
--- src/thread/PTHREAD/ThreadPThread.m3	16 Jan 2011 21:25:21 -0000	1.259
+++ src/thread/PTHREAD/ThreadPThread.m3	27 Apr 2012 18:06:43 -0000
@@ -782,4 +782,5 @@
           <*ASSERT act.state # ActState.Starting*>
           IF act.state # ActState.Stopped THEN
+            SetState(act, ActState.Stopping);
             SignalThread(act);
             INC(newlySent);
@@ -971,4 +972,5 @@
           <*ASSERT act.state # ActState.Starting*>
           IF act.state # ActState.Stopped THEN
+            SetState(act, ActState.Stopping);
             SignalThread(act);
             INC(newlySent);


On Apr 27, 2012, at 3:04 PM, Antony Hosking wrote:

> Platform?
> Thread stack dump?
> I assume it is a deadlock.
> If not deadlock then what?
> Diagnosis would then allow us to fix. 
> 
> Sent from my iPhone
> 
> On Apr 27, 2012, at 3:26 AM, Dragiša Durić <dragisha at m3w.org> wrote:
> 
>> Did anyone run combinations of tests and found minimal test sets where breaks happen?
>> 
>> I tried read,alloc and it breaks. read only does not.
>> 
>> From small number of tests I performed, it looks like RTAllocator is real culprit here. Most breaks happens while allocating, even one I saw in FileRd.Init() while running -tests read,alloc .




More information about the M3devel mailing list