Crash when using java debugger and kafka

Aleksey Shipilev shade at redhat.com
Thu Oct 31 10:33:33 UTC 2019


On 10/31/19 11:16 AM, Christopher Ng wrote:
> Hmm...not great news.  I pulled the latest build
> from https://builds.shipilev.net/openjdk-shenandoah-jdk8/ (openjdk-shenandoah-jdk8-latest-linux-x86_64-release.tar.xz
> 38M 2019-Oct-30 15:14).
> 
> The bug does not occur when running jdb/mvn (as in the test case)...but it still occurs when
> debugging from Intellij IDEA.  It's slightly better, now only 1 core locks up :).  Disabling class
> unloading does seem to stop the error occurring.

I have a theory about that. In 8u, there is another entry to JvmtiExport::weak_oops_do here:

diff -r e6ac5fb6c8a3 src/share/vm/runtime/jniHandles.cpp
--- a/src/share/vm/runtime/jniHandles.cpp       Tue Aug 13 14:59:29 2019 +0200
+++ b/src/share/vm/runtime/jniHandles.cpp       Thu Oct 31 11:30:10 2019 +0100
@@ -431,10 +431,16 @@

   /*
    * JVMTI data structures may also contain weak oops.  The iteration of them
    * is placed here so that we don't need to add it to each of the collectors.
    */
+#ifdef INCLUDE_ALL_GCS
+  if (UseShenandoahGC) {
+    // Do nothing, Shenandoah walks these separately. If we allow the walk here,
+    // then JvmtiExport would be visited by multiple threads and potentially livelock.
+  } else
+#endif
   JvmtiExport::weak_oops_do(is_alive, f);
 }

Let me dig up more details and propose a patch.

-- 
Thanks,
-Aleksey



More information about the shenandoah-dev mailing list