oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
626 stars 64 forks source link

[interop] NullPointerException when importing non-existing symbol #173

Open fniephaus opened 3 years ago

fniephaus commented 3 years ago

Repro

R -e 'import("doesNotExist")'

Tested with GraalVM-CE-Java11-20.3.0 on macOS Big Sur.

Error log

Sun Jan 03 12:57:43 CET 2021
java.lang.NullPointerException
    at org.graalvm.truffle/com.oracle.truffle.polyglot.EngineAccessor$EngineImpl.importSymbol(EngineAccessor.java:578)
    at org.graalvm.truffle/com.oracle.truffle.api.TruffleLanguage$Env.importSymbol(TruffleLanguage.java:2033)
    at com.oracle.truffle.r.nodes.builtin.fastr.FastRInterop$Import.importSymbol(FastRInterop.java:323)
    at com.oracle.truffle.r.nodes.builtin.fastr.FastRInteropFactory$ImportNodeGen.executeAndSpecialize(FastRInteropFactory.java:565)
    at com.oracle.truffle.r.nodes.builtin.fastr.FastRInteropFactory$ImportNodeGen.execute(FastRInteropFactory.java:544)
    at com.oracle.truffle.r.nodes.builtin.RBuiltinNode$Arg1.call(RBuiltinNode.java:176)
    at com.oracle.truffle.r.nodes.function.RCallNode$BuiltinCallNode.execute(RCallNode.java:1165)
    at com.oracle.truffle.r.nodes.function.RCallNode$FunctionDispatch.dispatch(RCallNode.java:921)
    at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.executeAndSpecialize(RCallNodeGen.java:745)
    at com.oracle.truffle.r.nodes.function.RCallNodeGen$FunctionDispatchNodeGen.execute(RCallNodeGen.java:709)
    at com.oracle.truffle.r.nodes.function.RCallNode.call(RCallNode.java:296)
    at com.oracle.truffle.r.nodes.function.RCallNodeGen.executeAndSpecialize(RCallNodeGen.java:236)
    at com.oracle.truffle.r.nodes.function.RCallNodeGen.execute(RCallNodeGen.java:210)
    at com.oracle.truffle.r.runtime.nodes.RNode.visibleExecute(RNode.java:74)
    at com.oracle.truffle.r.engine.REngine$AnonymousBodyNode.visibleExecute(REngine.java:740)
    at com.oracle.truffle.r.engine.REngine$AnonymousRootNode.execute(REngine.java:667)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:557)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:528)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:482)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:466)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:429)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:71)
    at com.oracle.truffle.r.engine.EngineRootNode$EngineBodyNode.execute(EngineRootNode.java:136)
    at com.oracle.truffle.r.engine.EngineRootNode.execute(EngineRootNode.java:86)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:557)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:528)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:482)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:466)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:416)
    at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:404)
    at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:941)
    at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:347)
    at com.oracle.truffle.r.launcher.REPL.lambda$readEvalPrint$1(REPL.java:119)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: Attached Guest Language Frames (2)
fniephaus commented 3 years ago

This still appears to be an issue in GraalVM CE 21.1 (checked with a recent dev build). Here's the stack trace log: fastr_errors_pid48916.log