|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000224||mercury||Bug||public||2011-10-24 11:59||2011-10-25 10:42|
|Target Version||Fixed in Version|
|Summary||0000224: STM broken without --inline-compound-threshold 10 --loop-invariants|
|Description||Attached is a basic mutex implementation using STM primitives. Compile with:|
mmc --parallel -O0 --inline-compound-threshold 10 --loop-invariants --rebuild stm_bug
And run. Program will behave as expected (uses 200% CPU on a multiproc platform, does not terminate).
Recompile without either one (or both) of "--inline-compound-threshold 10" or "--loop-invariants":
mmc --parallel -O0 --rebuild stm_bug
And run. Program soon terminates due to failed assertion about the state of the lock.
Behavior is identical under hlc.par grade (-H flag). Building without any optimization flags fails as well, since -O2 (the default) enables "--inline-compound-threshold 10" but not "--loop-invariants".
|Tags||No tags attached.|
|Note: in more complex programs I see behavior which I believe is triggered by this bug even with these optimizations enabled. I will attach a test case later.|
|The whole STM implementation is experimental and incomplete. It was worked on by two honours students in the past; noone is working on it currently. Bugs in it won't be fixed until we get someone else who wants to work on the STM system.|
|There was a race condition in the STM runtime -- reading an STM variable read the physical location multiple times without a lock. Attached is a patch against CVS which fixes this.|
|2011-10-24 11:59||colanderman||New Issue|
|2011-10-24 11:59||colanderman||File Added: stm_bug.m|
|2011-10-24 12:16||colanderman||Note Added: 0000369|
|2011-10-24 14:40||zs||Note Added: 0000370|
|2011-10-25 10:41||colanderman||File Added: stm.patch|
|2011-10-25 10:42||colanderman||Note Added: 0000373|