$ java --enable-native-access=ALL-UNNAMED -cp build/classes demo.Trap ValueLayout.ADDRESS : byteSize=0 getString(0) : IndexOutOfBoundsException, "No null terminator found..." reinterpret(100) : hello from C land C_POINTER : byteSize=9223372036854775807 getString(0) : hello from C land $ java --enable-native-access=ALL-UNNAMED -XX:ErrorFile=/tmp/jextract-hs_err.log -cp build/classes demo.NullText # first lines of the crash banner address=0 byteSize=9223372036854775807 equals(NULL)=true about to call getString(0) on it # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f002fe4645d, pid=20843, tid=20844 # # JRE version: OpenJDK Runtime Environment Temurin-25.0.5+8 (25.0.5+8) (build 25.0.5+8-LTS) # Java VM: OpenJDK 64-Bit Server VM Temurin-25.0.5+8 (25.0.5+8-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) exit code: 134