[native-image] SIGSEGV in DuplicationUtil$DuplicationOperation.classifyVirtual during [5/8] Inlining when building a GraalPy polyglot isolate
Target repo: https://github.com/oracle/graal Component: SubstrateVM / Graal compiler (code duplication phase) Severity: High (reproducible compiler crash; blocks native-image builds of GraalPy isolates)
Summary
Building a minimal GraalPy (Python) polyglot isolate with native-image on GraalVM CE
25.4.4.1.1+1.1 crashes with a SIGSEGV inside the Graal compiler's own code-duplication phase
(jdk.graal.compiler.duplication.util.DuplicationUtil$DuplicationOperation.classifyVirtual) during
the [5/8] Inlining step. The fault is a null-pointer dereference (SEGV_MAPERR at a near-null
address). The same application runs fine on the JVM with the same GraalVM — the crash is specific
to the AOT (native-image) compilation path.
Environment
- GraalVM: GraalVM CE 25.4.4.1.1+1.1 (build
25.0.4.1.1+1-jvmci-25.4-b23) - VM: OpenJDK 64-Bit Server VM, mixed mode, tiered, jvmci, jvmci compiler, compressed oops, compressed class ptrs, parallel gc, linux-amd64
- OS: Linux x86_64 (glibc),
substratevm.HostLibC=glibc - Guest language: GraalPy (Python) engine
25.4.4.1.1 - Build host: 72 cores, 251 GiB RAM (memory was NOT the constraint —
-J-Xmx8gand-J-Xmx16gboth crash)
Reproduction
A single Java class that builds a Python polyglot context:
import org.graalvm.polyglot.Context;
import org.graalvm.polyglot.Value;
public class Weld {
public static void main(String[] args) {
try (Context ctx = Context.newBuilder("python").allowExperimentalOptions(true).build()) {
ctx.eval("python", "def add(a,b): return a+b");
Value v = ctx.getBindings("python").getMember("add").execute(20, 22);
System.out.println("add(20,22) = " + v.asInt());
}
}
}Maven deps (both required): org.graalvm.polyglot:polyglot:25.4.4.1.1 (compile) +
org.graalvm.polyglot:python:25.4.4.1.1 type=pom (runtime).
Build command:
native-image \
-cp "target/classes:target/deps/*" \
-Dpolyglot.image-build-time.PreinitializeContexts=python \
-R:StackSize=16777216 \
-J-Xmx8g \
--no-server \
-o weld-native WeldActual result
Crashes at [5/8] Inlining with:
# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x0000703ab3d8aad2, pid=22868, tid=22972
# JRE version: OpenJDK Runtime Environment GraalVM CE 25.4.4.1.1+1.1 (25.0.4.1+1)
# (build 25.0.4.1.1+1-jvmci-25.4-b23)
# Problematic frame:
# J 39192 c1 jdk.graal.compiler.duplication.util.DuplicationUtil$DuplicationOperation.classifyVirtual
# (Ljdk/graal/compiler/nodes/VirtualState;Ljdk/graal/compiler/graph/Node;)
# Ljdk/graal/compiler/nodes/AbstractMergeNode; jdk.graal.compiler (409 bytes)
# @ 0x0000703ab3d8aad2 [0x0000703ab3d89000+0x0000000000001ad2]
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000250The faulting frame is compiled Java (C1) inside the Graal compiler itself — a null/near-null
dereference (RAX=0x248, fault at 0x250 = base+8) in the duplication phase's classifyVirtual.
The JVM's own stack-printing also re-faulted while reporting (SIGSEGV during error reporting), so the
full native stack is truncated in the report.
Expected result
The native-image build completes and produces a runnable weld-native binary (as it does for
non-polyglot and other polyglot isolates).
Notes / observations
- JVM path is clean. The identical
Weldclass runs correctly on the same GraalVM with full Graal JIT tiering (add(20,22)=42, JIT tiers 824→~165 ms). The crash is only on the native-image AOT path. - Reproducible across configs. Three attempts: (a) with a JNI-using main → stalled in analysis;
(b) no-JNI main
-J-Xmx16g→ died silently; (c) no-JNI--no-server -J-Xmx8g→ the clean SIGSEGV above. The crash is in the compiler's duplication/inlining phase regardless of heap size. - Memory is not the cause — 251 GiB host, crashes at 8g and 16g alike.
- The
hs_err_pid22868.log(full, ~374 KB) is available and can be attached.
Question
Is this a known issue in the 25.4.4.1.1 / jvmci-25.4-b23 duplication phase with GraalPy isolates,
and is there a fixed build or a workaround (e.g. disabling the duplication phase, a different
PreinitializeContexts setting, or a newer graal release) we can use to get a native-image GraalPy
isolate?
Source: oracle/graal