BZ #157: SMP ARM Assertion `get_thin_lock_without_count() == thread_get_current()->thinlock' failed.

Status fields:

creation_ts:2011-03-09 14:38
component:locks
version:default branch
rep_platform:arm
op_sys:Linux
bug_status:RESOLVED
resolution:FIXED
reporter:xerxes@zafena.se
Testcase triggers on a dualcore ARM Toshiba ac100 running Ubuntu 10.10: and
on a dualcore ARM PandaBoard running Ubuntu Natty.
The same test passes on a singlecore ARM machine running Debian Squeeze using the same
cacao binarys.

Testcase:
mkdir cm30
cd cm30
wget http://www.benchmarkhq.ru/cm30/cmkit.zip
unzip cmkit.zip
java CaffeineMarkApp
(click Test->Run All Tests Locally)

when during the last Dialog test the jvm exit with an assertion:
Output:
CACAO (build 1.1.0pre2, compiled mode)
xranby@ac100 /media/Hans/test/cm30$ java CaffeineMarkApp
java: lockword.cpp:53: void Lockword::inflate(lock_record_t*): Assertion
`get_thin_lock_without_count() == thread_get_current()->thinlock' failed.
Aborted

Comment #1 by xerxes@zafena.se on 2011-03-09 14:53:04

Breakpoint 3, 0x401a6a24 in __assert_fail () from /lib/libc.so.6
(gdb) bt
#0  0x401a6a24 in __assert_fail () from /lib/libc.so.6
#1  0x4029d9e8 in Lockword::inflate (this=0x450a691c, lr=0x1c616e8)
    at lockword.cpp:53
#2  0x4029d1f0 in lock_inflate (t=0xaa99a0, o=0xb548b8) at lock.cpp:706
#3  notify_flc_waiters (t=0xaa99a0, o=0xb548b8) at lock.cpp:820
#4  0x4029d2d0 in lock_monitor_exit (o=0xb548b8) at lock.cpp:1002
#5  0x44ae78ac in ?? ()
#6  0x44ae78ac in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

Comment #2 by xerxes@zafena.se on 2011-03-09 16:42:05

Created an attachment (id=74)
cacao-memorybarriers-arm.patch

The attached patch fix by using the Linux kernel "memory barrier" helper.

Comment #3 by stefan@complang.tuwien.ac.at on 2011-03-11 23:57:28

ARM didn't have memory barriers at all. Fixed:
http://mips.complang.tuwien.ac.at/hg/cacao/rev/c7bf150bfa46

Attachment id=74

date:2011-03-09 16:42
desc:cacao-memorybarriers-arm.patch
type:text/plain
download:cacao-memorybarriers-arm.patch