RFR(S): 8032011 nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239

Roland Westrelin roland.westrelin at oracle.com
Mon Feb 10 15:07:20 PST 2014

With the code sketched below:

m1() {
  synchronized(monitor) { // eliminated by c2
    m2(); // deoptimized here

m2() {
  synchronized(monitor) { // not eliminated but biased to current thread
    // uncommon trap

1) In m1(), the monitor is eliminated
2) m2() calls m1(), the monitor is acquired biased to current thread
3) uncommon trap happens in m2() which causes the bias on monitor to be revoked. The monitor is erroneoulsy locked using a basic lock in m1()
4) execution returns to m1() which is mark for deoptimization. Deoptimization tries to relock the eliminated monitor but find it already locked by current thread which should be impossible.

Skipping all eliminated monitors in get_or_compute_monitor_info() makes sure revoke_bias does not lock the monitor using a basic lock in the wrong frame.



More information about the hotspot-compiler-dev mailing list