Skip to content

Commit 518b8bc

Browse files
committed
Ignore threads reporting a fatal error during GC.
1 parent 567fca0 commit 518b8bc

File tree

1 file changed

+11
-0
lines changed
  • substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge

1 file changed

+11
-0
lines changed

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/GCImpl.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,17 @@ private void blackenStackRoots() {
783783
*/
784784
continue;
785785
}
786+
if (VMThreads.StatusSupport.isStatusIgnoreSafepoints(vmThread)) {
787+
/*
788+
* When a thread is ignoring safepoints, it is reporting a fatal VM error.
789+
* The thread is not paused and we cannot safely walk its stack (we don't
790+
* even know where it starts). We simply ignore it and keep collecting until
791+
* it terminates the VM rather than crashing here. The thread might access
792+
* the heap to print diagnostics, but it must do so with due caution and
793+
* should not crash because of our ongoing GC.
794+
*/
795+
continue;
796+
}
786797
if (JavaStackWalker.initWalk(walk, vmThread)) {
787798
walkStack(walk);
788799
}

0 commit comments

Comments
 (0)