JDK-8324225 : Shenandoah: VMThread may become unable to complete safepoint synchronization
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 17.0.9,17.0.10
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2024-01-19
  • Updated: 2024-07-23
  • Resolved: 2024-07-23
Related Reports
Duplicate :  
Relates :  
Description
This issue was reported to the mailing list: https://mail.openjdk.org/pipermail/shenandoah-dev/2024-January/021138.html

The interesting stack traces here are:

The deadlock detector is requesting a safepoint operation:
```
#4  0x00007f973aa0d5da in VMThread::wait_until_executed(VM_Operation*) () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#5  0x00007f973aa0dd23 in VMThread::execute(VM_Operation*) () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#6  0x00007f973a664e3a in find_deadlocks(bool, JavaThread*) () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#7  0x00007f973a665117 in jmm_FindDeadlockedThreads () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
```

The VM thread is iteratively waiting for threads to reach the safepoint (so, more of a "live" lock situation):
```
#2  0x00007f973a738649 in os::naked_short_sleep(long) () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#3  0x00007f973a7de4fa in SafepointSynchronize::synchronize_threads(long, int, int*) () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#4  0x00007f973a7df5c4 in SafepointSynchronize::begin() () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#5  0x00007f973aa0dae5 in VMThread::inner_execute(VM_Operation*) () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#6  0x00007f973aa0de37 in VMThread::run() () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
```

There is a Shenandoah worker thread trying to join the safepoint:
```
#3  0x00007f973a6e55cd in Monitor::wait_without_safepoint_check(long) () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#4  0x00007f973a91b91a in SuspendibleThreadSet::join() () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#5  0x00007f973a833530 in ShenandoahConcurrentWeakRootsEvacUpdateTask::work(unsigned int) () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#6  0x00007f973aa3d321 in GangWorker::loop() () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
#7  0x00007f973aa3d382 in GangWorker::run() () from /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc39.x86_64/lib/server/libjvm.so
```

Comments
Yes, same issue. The thread dump from this ticket shows the sweeper thread trying to unregister an nmethod.
23-07-2024

I believe this is a duplicate of JDK-8334482, close it as Duplicate?
23-07-2024