|
27 | 27 | import static com.oracle.svm.core.heap.RestrictHeapAccess.Access.NO_ALLOCATION; |
28 | 28 |
|
29 | 29 | import org.graalvm.compiler.nodes.UnreachableNode; |
| 30 | +import org.graalvm.nativeimage.CurrentIsolate; |
30 | 31 | import org.graalvm.nativeimage.ImageSingletons; |
| 32 | +import org.graalvm.nativeimage.Isolate; |
31 | 33 | import org.graalvm.nativeimage.LogHandler; |
32 | 34 | import org.graalvm.nativeimage.Platforms; |
33 | 35 | import org.graalvm.nativeimage.c.function.CodePointer; |
34 | 36 | import org.graalvm.nativeimage.impl.InternalPlatform; |
35 | 37 |
|
36 | 38 | import com.oracle.svm.core.NeverInline; |
37 | 39 | import com.oracle.svm.core.SubstrateDiagnostics; |
| 40 | +import com.oracle.svm.core.SubstrateOptions; |
38 | 41 | import com.oracle.svm.core.Uninterruptible; |
39 | 42 | import com.oracle.svm.core.annotate.Substitute; |
40 | 43 | import com.oracle.svm.core.annotate.TargetClass; |
| 44 | +import com.oracle.svm.core.c.function.CEntryPointActions; |
41 | 45 | import com.oracle.svm.core.heap.RestrictHeapAccess; |
42 | 46 | import com.oracle.svm.core.log.Log; |
43 | 47 | import com.oracle.svm.core.snippets.KnownIntrinsics; |
@@ -135,6 +139,10 @@ public class VMErrorSubstitutions { |
135 | 139 | static RuntimeException shouldNotReachHere(CodePointer callerIP, String msg, Throwable ex) { |
136 | 140 | ThreadStackPrinter.printBacktrace(); |
137 | 141 |
|
| 142 | + if (SubstrateOptions.SpawnIsolates.getValue() && CurrentIsolate.getCurrentThread().isNull()) { |
| 143 | + CEntryPointActions.enterAttachThreadFromCrashHandler((Isolate) KnownIntrinsics.heapBase()); |
| 144 | + } |
| 145 | + |
138 | 146 | SafepointBehavior.preventSafepoints(); |
139 | 147 | StackOverflowCheck.singleton().disableStackOverflowChecksForFatalError(); |
140 | 148 |
|
|
0 commit comments