oracle / graalpython

A Python 3 implementation built on GraalVM
Other
1.2k stars 103 forks source link

getBindings("python").getMemberKeys()) returns NPE #337

Closed timfel closed 1 year ago

timfel commented 1 year ago

Via Slack by Kfir Tishbi

After upgrading to 23.0.0, when we call .getBindings("python").getMemberKeys()) returns NPE

org.graalvm.polyglot.PolyglotException: java.lang.NullPointerException: Invalid parameter type passed to updater. Instance of type 'PythonMapScopeGen.InteropLibraryExports.Cached' expected but was 'null'. Did you pass the wrong node to an execute method of an inlined cached node?
    at app/org.graalvm.truffle/com.oracle.truffle.api.dsl.InlineSupport$InlinableField.invalidAccessError(InlineSupport.java:409)
    at app/org.graalvm.truffle/com.oracle.truffle.api.dsl.InlineSupport$UnsafeField.getInt(InlineSupport.java:1282)
    at app/org.graalvm.truffle/com.oracle.truffle.api.dsl.InlineSupport$StateField.get(InlineSupport.java:510)
    at app/org.graalvm.truffle/com.oracle.truffle.api.profiles.InlinedIntValueProfile.profile(InlinedIntValueProfile.java:99)
    at com.oracle.graal.python.runtime.interop.PythonMapScope.getMembers(PythonMapScope.java:124)
    at com.oracle.graal.python.runtime.interop.PythonMapScopeGen$InteropLibraryExports$Cached.getMembersNode_AndSpecialize(PythonMapScopeGen.java:184)
    at com.oracle.graal.python.runtime.interop.PythonMapScopeGen$InteropLibraryExports$Cached.getMembers(PythonMapScopeGen.java:160)
    at app/org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary$Asserts.getMembers(InteropLibrary.java:3581)
    at app/org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibrary.getMembers(InteropLibrary.java:733)
    at app/org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatch$InteropValue$GetMemberKeysNode.doCached(PolyglotValueDispatch.java:3357)
    at app/org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$GetMemberKeysNodeGen.executeAndSpecialize(PolyglotValueDispatchFactory.java:2661)
    at app/org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotValueDispatchFactory$InteropValueFactory$GetMemberKeysNodeGen.executeImpl(PolyglotValueDispatchFactory.java:2609)
    at app/org.graalvm.truffle/com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:124)
    at app/org.graalvm.sdk/org.graalvm.polyglot.Value.getMemberKeys(Value.java:811)
timfel commented 1 year ago

Fixed on master