`MemoryError` during parse can escalate to `SystemError` and abort on small input
Aperta
Nessuno ha ancora preso questa issue.
interpreter-core
topic-parser
type-crash
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Crash report
What happened?
string = (
b'(*h(((h(h(h(' +
b'[' * 35 +
b'*h(' +
b'[' * 38 +
b'**h(' +
b'[' * 31 +
b'(' * 4 +
b'~' * 20 +
b'F{' +
b'[' * 27 +
b'**h(' +
b'[' * 31 +
b'(' * 4 +
b'~' * 23 +
b'F{F"{F"{F"{F"{F"{F"{F"{FF""{{F"{""{F"{F{{F"{F"{F"\\}'
)
compile(string, "<input>", "single")
Gives me:
Fatal Python error: _Py_CheckFunctionResult: a function returned a result with an exception set
Python runtime state: initialized
MemoryError: Parser stack overflowed - Python source too complex to parse
The above exception was the direct cause of the following exception:
SystemError: <class 'SyntaxWarning'> returned a result with an exception set
Current thread 0x00007efd1b8e8780 [python] (most recent call first):
File "/tmp/repro.py", line 19 in <module>
Aborted (core dumped) ./python /tmp/repro.py
Found by OSS-Fuzz.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Output from running 'python -VV' on the command line:
No response
Linked PRs
- gh-150067
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Esegui il riproduttore compile() fornito su CPython main e confronta il suo errore MemoryError/SystemError con l’abort fatale segnalato. Leggi la gestione del parser e di SyntaxWarning coinvolta, quindi esamina la PR collegata gh-150067. Il lavoro è completato quando l’input non causa più l’abort dell’interprete né fa degenerare l’errore del parser in un SystemError.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 20/100