Open hubertp opened 2 months ago
[WARN] [2024-09-16T14:45:35.283] [enso.org.enso.interpreter.service.ExecutionService] Execution of function main failed (Cannot invoke "Object.getClass()" because "arg2Value" is null).
java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "arg2Value" is null
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContextFactory$ToHostValueNodeGen$Inlined.execute(PolyglotLanguageContextFactory.java:84)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$SharedInvokeNode.doDefault(PolyglotValueDispatch.java:4781)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$SharedInvokeNodeGen$Inlined.executeShared(PolyglotValueDispatchFactory.java:10501)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$InvokeNode.doDefault(PolyglotValueDispatch.java:4821)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$InvokeNodeGen.executeImpl(PolyglotValueDispatchFactory.java:10729)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:124)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:745)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedRuntimeSupport.callProfiled(OptimizedRuntimeSupport.java:266)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue.invoke(PolyglotValueDispatch.java:2662)
at org.graalvm.polyglot/org.graalvm.polyglot.Value.invokeMember(Value.java:1023)
at org.enso.base.polyglot.EnsoMeta.getType(EnsoMeta.java:15)
at org.enso.base.file_format.FileFormatSPI.getTypeObject(FileFormatSPI.java:48)
at org.enso.base.file_format.FileFormatSPI.lambda$get_types$0(FileFormatSPI.java:17)
...
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8f8b60cfa, pid=16364, tid=38040
#
# JRE version: OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (21.0.2+13) (build 21.0.2+13-jvmci-23.1-b30)
# Java VM: OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (21.0.2+13-jvmci-23.1-b30, mixed mode, sharing, tiered, jvmci, jvmci compiler, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C [enso_parser.dll+0x30cfa]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# https://github.com/oracle/graal/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
and core dump: hs_err_pid16364.log
Please note the last line in this exception is at org.enso.base.polyglot.EnsoMeta.getType
- e.g. it is a library code. There is no sign of any Enso engine code running. I suggest to patch with:
$ git diff std-bits/base/src/main/java/org/enso/base/polyglot/EnsoMeta.java
diff --git std-bits/base/src/main/java/org/enso/base/polyglot/EnsoMeta.java std-bits/base/src/main/java/org/enso/base/polyglot/EnsoMeta.java
index 249dcd2ad5..b56ff57aef 100644
--- std-bits/base/src/main/java/org/enso/base/polyglot/EnsoMeta.java
+++ std-bits/base/src/main/java/org/enso/base/polyglot/EnsoMeta.java
@@ -12,7 +12,13 @@ public final class EnsoMeta {
/** Returns a type object from the Enso runtime. */
public static Value getType(String moduleName, String typeName) {
var module = getBindings().invokeMember("get_module", moduleName);
- return module.invokeMember("get_type", typeName);
+ try {
+ return module.invokeMember("get_type", typeName);
+ } catch (NullPointerException e) {
+ var ex = new NullPointerException("Cannot get type for " + moduleName + " type: " + typeName + " at " + module);
+ ex.initCause(ex);
+ throw ex;
+ }
}
/** Calls a static method defined directly on a module (not inside of a type). */
and wait until it reproduces.
$ git diff std-bits/base/src/main/java/org/enso/base/polyglot/EnsoMeta.java diff --git std-bits/base/src/main/java/org/enso/base/polyglot/EnsoMeta.java std-bits/base/src/main/java/org/enso/base/polyglot/EnsoMeta.java index 249dcd2ad5..b56ff57aef 100644 --- std-bits/base/src/main/java/org/enso/base/polyglot/EnsoMeta.java +++ std-bits/base/src/main/java/org/enso/base/polyglot/EnsoMeta.java @@ -12,7 +12,13 @@ public final class EnsoMeta { /** Returns a type object from the Enso runtime. */ public static Value getType(String moduleName, String typeName) { var module = getBindings().invokeMember("get_module", moduleName); - return module.invokeMember("get_type", typeName); + try { + return module.invokeMember("get_type", typeName); + } catch (NullPointerException npe) { + var ex = new NullPointerException("Cannot get type for " + moduleName + " type: " + typeName + " at " + module); + ex.initCause(npe); + throw ex; + } } /** Calls a static method defined directly on a module (not inside of a type). */
The enhanced logging diff has been integrated by #11125. Now we need a new bug report with the additional info.
and another exception reported as #11104