RFR (XS) 8232534: Shenandoah: guard against reentrant ShenandoahHeapLock locking

Aleksey Shipilev shade at redhat.com
Thu Oct 17 17:00:30 UTC 2019


RFE:
  https://bugs.openjdk.java.net/browse/JDK-8232534

This one was very useful for debugging:

diff -r 55fe0d93bdd3 src/hotspot/share/gc/shenandoah/shenandoahLock.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp        Tue Oct 15 22:22:23 2019 -0400
+++ b/src/hotspot/share/gc/shenandoah/shenandoahLock.hpp        Thu Oct 17 18:59:27 2019 +0200
@@ -39,10 +39,13 @@

 public:
   ShenandoahLock() : _state(unlocked), _owner(NULL) {};

   void lock() {
+#ifdef ASSERT
+    assert(_owner != Thread::current(), "reentrant locking attempt, would deadlock");
+#endif
     Thread::SpinAcquire(&_state, "Shenandoah Heap Lock");
 #ifdef ASSERT
     assert(_state == locked, "must be locked");
     assert(_owner == NULL, "must not be owned");
     _owner = Thread::current();

Testing: hotspot_gc_shenandoah; multiple assert failures due to bugs in development

-- 
Thanks,
-Aleksey




More information about the hotspot-gc-dev mailing list