Skip to content

[Bug]: ClassCastException: Invalid inline context node passed to an inlined field #973

@correctmost

Description

@correctmost

Describe the bug

GraalPy crashes when running this fuzzed code:

exec('class C:\n def m[T]() -> int: ...')
exec('class C:\n def m[T]() -> int: ...')

Operating system

Linux

CPU architecture

x86_64

GraalPy version

GraalPy 3.12.8 (Oracle GraalVM Native 25.0.3)

JDK version

No response

Context configuration

No response

Steps to reproduce

Snippet listed above

Expected behavior

No crash

Stack trace

Invalid inline context node passed to an inlined field. A receiver of type 'ReadFromDictOrGlobalsNodeGen' was expected but is 'PyObjectGetItemNodeGen.Inlined'. Did you pass the wrong node to an execute method of an inlined cached node?
java.lang.ClassCastException: Invalid inline context node passed to an inlined field. A receiver of type 'ReadFromDictOrGlobalsNodeGen' was expected but is 'PyObjectGetItemNodeGen.Inlined'. Did you pass the wrong node to an execute method of an inlined cached node?
	at org.graalvm.truffle/com.oracle.truffle.api.dsl.InlineSupport$UnsafeField.invalidReceiver(InlineSupport.java:1254)
	at org.graalvm.truffle/com.oracle.truffle.api.dsl.InlineSupport$UnsafeField.nullError(InlineSupport.java:1240)
	at org.graalvm.truffle/com.oracle.truffle.api.dsl.InlineSupport$UnsafeField.resolveReceiverSlow(InlineSupport.java:1204)
	at org.graalvm.truffle/com.oracle.truffle.api.dsl.InlineSupport$UnsafeField.resolveReceiver(InlineSupport.java:1176)
	at org.graalvm.truffle/com.oracle.truffle.api.dsl.InlineSupport$UnsafeField.getInt(InlineSupport.java:1276)
	at org.graalvm.truffle/com.oracle.truffle.api.dsl.InlineSupport$StateField.get(InlineSupport.java:464)
	at org.graalvm.py/com.oracle.graal.python.lib.PyObjectGetItemNodeGen$Inlined.execute(PyObjectGetItemNodeGen.java:256)
	at org.graalvm.py/com.oracle.graal.python.lib.PyObjectGetItem.executeCached(PyObjectGetItem.java:92)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode.ReadFromDictOrGlobalsNode.read(ReadFromDictOrGlobalsNode.java:80)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode.ReadFromDictOrGlobalsNodeGen.executeAndSpecialize(ReadFromDictOrGlobalsNodeGen.java:149)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode.ReadFromDictOrGlobalsNodeGen.execute(ReadFromDictOrGlobalsNodeGen.java:135)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode.PBytecodeRootNode.bytecodeLoadFromDictOrGlobals(PBytecodeRootNode.java:4853)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode.PBytecodeRootNode.infrequentBytecodes(PBytecodeRootNode.java:2433)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode.PBytecodeRootNode.bytecodeLoop(PBytecodeRootNode.java:2311)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode.PBytecodeRootNode.executeCached(PBytecodeRootNode.java:1257)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode.PBytecodeRootNode.executeFromBci(PBytecodeRootNode.java:1242)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode.PBytecodeRootNode.execute(PBytecodeRootNode.java:1092)
[...snip...]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions