Skip to content

Commit 03cf2bf

Browse files
committed
[GR-65416] Disable signal handling for compilation isolates
* The compilation isolates do not need or use signal handling. * Otherwise it's very complicated to disable InstallSegfaultHandler for Truffle languages as it would get automatically enabled for the compilation isolate, due to -R:+EnableSignalHandling -R:+InstallSegfaultHandler passed when building Truffle language native images.
1 parent ad6ef9f commit 03cf2bf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateSegfaultHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private static boolean isFirst() {
129129
public abstract class SubstrateSegfaultHandler {
130130
public static class Options {
131131
@Option(help = "Install segfault handler that prints register contents and full Java stacktrace. Default: enabled for an executable, disabled for a shared library, disabled when EnableSignalHandling is disabled.")//
132-
static final RuntimeOptionKey<Boolean> InstallSegfaultHandler = new RuntimeOptionKey<>(null);
132+
public static final RuntimeOptionKey<Boolean> InstallSegfaultHandler = new RuntimeOptionKey<>(null);
133133
}
134134

135135
private static final long MARKER_VALUE = 0x0123456789ABCDEFL;

substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/isolated/IsolatedGraalUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.lang.reflect.Array;
2828
import java.nio.ByteBuffer;
2929

30+
import com.oracle.svm.core.SubstrateSegfaultHandler;
3031
import org.graalvm.collections.EconomicMap;
3132
import org.graalvm.nativeimage.CurrentIsolate;
3233
import org.graalvm.nativeimage.Isolates;
@@ -127,6 +128,10 @@ private static void appendOptionsRelevantForCompilationIsolates(CreateIsolatePar
127128

128129
/* Compilation isolates do the reference handling manually to avoid the extra thread. */
129130
appendArgument(builder, SubstrateOptions.ConcealedOptions.AutomaticReferenceHandling, false);
131+
132+
/* Disable signal handling for compilation isolates. */
133+
appendArgument(builder, SubstrateOptions.EnableSignalHandling, false);
134+
appendArgument(builder, SubstrateSegfaultHandler.Options.InstallSegfaultHandler, false);
130135
}
131136

132137
private static void appendOptionsExplicitlySetForCompilationIsolates(CreateIsolateParameters.Builder builder) {

0 commit comments

Comments
 (0)