RFR: ShenandoahRuntime::load_reference_barrier_native should not accept second parameter

Aleksey Shipilev shade at redhat.com
Thu Sep 5 19:45:36 UTC 2019


Hi,

There are massive x86_32 failures with sh/jdk, but only in release mode. Zhengyu pinpointed it to
this changeset:

 changeset:   56771:40c0f1f47ca5
 parent:      56666:af48b07d0312
 parent:      56770:28ab01c06755
 user:        rkennke
 date:        Sun Jul 28 22:14:16 2019 +0200
 summary:     Merge

However, both parents (af48b07d0312 and 28ab01c06755) are running fine! So whatever broke it was
done in the merge itself.

I believe the cause is calling ShenandoahRuntime::load_reference_barrier_native from everywhere with
only one argument (the object itself), but the native method signature actually expects another
argument. So calling convention gets foobared. This might be why we only see it with x86_32, where
second argument is passed on stack, and so stack becomes foobared after this call.

Fix:

diff -r 40c0f1f47ca5 src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp     Sun Jul 28 22:14:16 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp     Thu Sep 05 21:38:06 2019 +0200
@@ -74,5 +74,5 @@
 JRT_END

-JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_native(oopDesc * src, oop* load_addr))
+JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_native(oopDesc * src))
   return (oopDesc*) ShenandoahBarrierSet::barrier_set()->oop_load_from_native_barrier(oop(src));
 JRT_END
diff -r 40c0f1f47ca5 src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp     Sun Jul 28 22:14:16 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp     Thu Sep 05 21:38:06 2019 +0200
@@ -42,5 +42,5 @@
   static oopDesc* load_reference_barrier_fixup_narrow(oopDesc* src, narrowOop* load_addr);

-  static oopDesc* load_reference_barrier_native(oopDesc* src, oop* load_addr);
+  static oopDesc* load_reference_barrier_native(oopDesc* src);

   static void shenandoah_clone_barrier(oopDesc* obj);

Testing: hotspot_gc_shenandoah x86_32 {fastdebug,release}

-- 
Thanks,
-Aleksey



More information about the shenandoah-dev mailing list