[aarch64-port-dev ] RFR: Fix guarantee failure in syncronizer.cpp

Edward Nevill edward.nevill at linaro.org
Thu Jan 8 13:00:12 UTC 2015


Hi,

The following patch fixes a guarantee failure

#  Internal Error (synchronizer.cpp:1430), pid=23066, tid=4393646813680
#  guarantee(mid->header()->is_neutral()) failed: invariant

The problem would seem to be that using stxr in the lock updating code the updated value of the header does not become immediately visible. The solution is to use stlxr instead.

The patch below is for jdk8 but parallel patches are needed for jdk7 and jdk9.

All the best,
Ed.

--- CUT HERE ---
# HG changeset patch
# User enevill
# Date 1420721252 0
#      Thu Jan 08 12:47:32 2015 +0000
# Node ID 06c52e8fd6d340918f14faabc9f7b62366a38c31
# Parent  c47a4731e5e09f05023f169049836f5022eaeadb
Fix guarantee failure in syncronizer.cpp

diff -r c47a4731e5e0 -r 06c52e8fd6d3 src/cpu/aarch64/vm/aarch64.ad
--- a/src/cpu/aarch64/vm/aarch64.ad	Tue Jan 06 15:57:27 2015 +0000
+++ b/src/cpu/aarch64/vm/aarch64.ad	Thu Jan 08 12:47:32 2015 +0000
@@ -2968,7 +2968,8 @@
       __ ldxr(tmp, oop);
       __ cmp(tmp, disp_hdr);
       __ br(Assembler::NE, cas_failed);
-      __ stxr(tmp, box, oop);
+      // use stlxr to ensure update is immediately visible
+      __ stlxr(tmp, box, oop);
       __ cbzw(tmp, cont);
       __ b(retry_load);
     }
@@ -3017,7 +3018,8 @@
 	__ ldxr(rscratch1, tmp);
 	__ cmp(disp_hdr, rscratch1);
 	__ br(Assembler::NE, fail);
-	__ stxr(rscratch1, rthread, tmp);
+        // use stlxr to ensure update is immediately visible
+	__ stlxr(rscratch1, rthread, tmp);
 	__ cbnzw(rscratch1, retry_load);
 	__ bind(fail);
       }
@@ -3105,7 +3107,8 @@
 	__ ldxr(tmp, oop);
 	__ cmp(box, tmp);
 	__ br(Assembler::NE, cas_failed);
-	__ stxr(tmp, disp_hdr, oop);
+        // use stlxr to ensure update is immediately visible
+	__ stlxr(tmp, disp_hdr, oop);
 	__ cbzw(tmp, cont);
 	__ b(retry_load);
       }
--- CUT HERE ---




More information about the aarch64-port-dev mailing list