-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
OS X 10.7.5
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_45-b18 +indy [darwin-x86_64]
[via rvm 1.24.7 (stable)]
I am observing a consistent failure of assignment to a global in a unit test that defies debugging, because running the code with the debugger (even without break points set) makes the problem vanish.
I've resorted to console output debugging that you can see a snapshot of below. The key things to know:
- Multi-threading issues shouldn't be at play here, since the unit test is not explicitly multithreaded
- Even if multithreading were an issue, the code in question is executed within a synchronized block,
$vm_lockis an instance ofjava.lang.Object, and no other code in the code base accesses$cache_load_numberfor reading or writing outside of a block synchronized on$vm_lock - The test consistently fails incrementing
$cache_load_numberfrom 100 to 101, every time. - I have tried both
$cache_load_number += 1and$cache_load_number = $cache_load_number + 1and the results are identical
The output observed, shown in the console log should be impossible:
Cache Load Number: 100 before increment (Fixnum)
Cache Load Number: 100 end of synchronized block (Fixnum)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
