`MemoryError` during parse can escalate to `SystemError` and abort on small input
Abierto
Nadie ha tomado este issue todavía.
interpreter-core
topic-parser
type-crash
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Ejecuta el reproductor de compile() proporcionado en CPython main y compara su fallo MemoryError/SystemError con el aborto fatal informado. Lee el manejo del parser y de SyntaxWarning implicado y, después, revisa el PR vinculado gh-150067. Se considerará terminado cuando la entrada ya no aborte el intérprete ni escale el error del parser a un SystemError.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- compilers
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 20/100