[concurrency-interest] ReentrantLock bug?

Aleksey Shipilev aleksey.shipilev at oracle.com
Thu Mar 19 16:32:30 EDT 2015


On 03/19/2015 11:02 PM, Dmitry Zaslavsky wrote:
> Apologies for such a silly report / question.
> 
>     I have an application that out 100s of machines, every couple of runs would get into a state that’s only possible if ReentrantLock has a bug.
>     While it would be hard to repro locally. On the grid it’s quite easy to repeat.
>     Of course it’s possible I am doing something something very wrong.
>     One time I saw RL in a locked state but the owner was null.
>     I replaced all the uses of _lock.lock() try {} finally { _lock.unlock(); } with synchronized(_lock) and the problem went away.
> 
>    Still using jdk 7 u21
>    Any suggestions?

The usual things:

 a) Update the JDK to at least 7u40 (or even better, JDK 8u40);
 b) -Xbootclasspath/p: the latest jsr166.jar (only works with JDK 8, I
think);

We have experimental RL tests in jcstress [1], you may want to try those
on your target machines.

-Aleksey.

[1]
http://hg.openjdk.java.net/code-tools/jcstress/file/5fcd4f948639/tests-custom/src/main/java/org/openjdk/jcstress/tests/locks


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20150319/577cd713/attachment.bin>


More information about the Concurrency-interest mailing list