[Bug]: NullPointerException with lambda and await

Aperta
#1,285 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java, python
Ambito
backend

Direzione di ricerca

Start with the stack trace in RootNodeCompiler.StatementCompiler.visit and the await handling in GraalPy's bytecode DSL compiler. Reproduce the crash with lambda: await x in the reported GraalPy native build, then trace how the compiler raises the syntax error. Done means the snippet produces the expected syntax behavior without a NullPointerException.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Describe the bug

GraalPy crashes when running this fuzzed code:

lambda: await x
Operating system

Linux

CPU architecture

x86_64

GraalPy version

GraalPy 3.13.14 (Oracle GraalVM Native 25.5.5.0.3)

JDK version

No response

Context configuration

No response

Steps to reproduce

Snippet listed above

Expected behavior

No crash

Stack trace
java.lang.NullPointerException: Stack trace is imprecise, the top frames are missing and/or have wrong line numbers. To get precise stack traces, build the image with option -H:-ReduceImplicitExceptionStackTraceInformation
	at org.graalvm.py/com.oracle.graal.python.compiler.ParserCallbacksImpl.raiseSyntaxError(ParserCallbacksImpl.java:126)
	at org.graalvm.py/com.oracle.graal.python.compiler.ParserCallbacksImpl.raiseSyntaxError(ParserCallbacksImpl.java:122)
	at org.graalvm.py/com.oracle.graal.python.compiler.ParserCallbacksImpl.onError(ParserCallbacksImpl.java:118)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler$StatementCompiler.visit(RootNodeCompiler.java:2178)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler$StatementCompiler.visit(RootNodeCompiler.java:2033)
	at org.graalvm.py/com.oracle.graal.python.pegparser.sst.ExprTy$Await.accept(ExprTy.java:281)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.emitFunctionDefBody(RootNodeCompiler.java:1259)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.lambda$visit$3(RootNodeCompiler.java:1229)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode_dsl.PBytecodeDSLRootNodeGen$Bytecode.create(PBytecodeDSLRootNodeGen.java:5219)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode_dsl.PBytecodeDSLRootNodeGen.create(PBytecodeDSLRootNodeGen.java:3972)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.compileRootNode(RootNodeCompiler.java:533)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.visit(RootNodeCompiler.java:1228)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.visit(RootNodeCompiler.java:189)
	at org.graalvm.py/com.oracle.graal.python.pegparser.sst.ExprTy$Lambda.accept(ExprTy.java:144)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.compile(RootNodeCompiler.java:758)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler$StatementCompiler.compileNode(RootNodeCompiler.java:4880)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler$StatementCompiler.emitMakeFunction(RootNodeCompiler.java:4798)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler$StatementCompiler.visit(RootNodeCompiler.java:3026)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler$StatementCompiler.visit(RootNodeCompiler.java:2033)
	at org.graalvm.py/com.oracle.graal.python.pegparser.sst.ExprTy$Lambda.accept(ExprTy.java:144)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.visitModuleBody(RootNodeCompiler.java:1087)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.lambda$visit$0(RootNodeCompiler.java:1009)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode_dsl.PBytecodeDSLRootNodeGen$Bytecode.create(PBytecodeDSLRootNodeGen.java:5219)
	at org.graalvm.py/com.oracle.graal.python.nodes.bytecode_dsl.PBytecodeDSLRootNodeGen.create(PBytecodeDSLRootNodeGen.java:3972)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.compileRootNode(RootNodeCompiler.java:533)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.visit(RootNodeCompiler.java:1007)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.visit(RootNodeCompiler.java:189)
	at org.graalvm.py/com.oracle.graal.python.pegparser.sst.ModTy$Module.accept(ModTy.java:68)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.RootNodeCompiler.compile(RootNodeCompiler.java:758)
	at org.graalvm.py/com.oracle.graal.python.compiler.bytecode_dsl.BytecodeDSLCompiler.compile(BytecodeDSLCompiler.java:90)
	at org.graalvm.py/com.oracle.graal.python.PythonLanguage.compileForBytecodeDSLInterpreter(PythonLanguage.java:675)
	at org.graalvm.py/com.oracle.graal.python.PythonLanguage.compileModule(PythonLanguage.java:647)
	at org.graalvm.py/com.oracle.graal.python.PythonLanguage.parse(PythonLanguage.java:615)
	at org.graalvm.py/com.oracle.graal.python.PythonLanguage.parse(PythonLanguage.java:602)
	at org.graalvm.py/com.oracle.graal.python.PythonLanguage.parse(PythonLanguage.java:588)
[...snip...]
Additional context

No response

Lingua principale
Python
Stelle
1.7k
Fork
167
Merge medio
3g 11h
PR unite (30g)
68

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oracle/graalpython

Tutte le issue di oracle/graalpython

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.