New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault when printing MemoryError raised through PyErr_NoMemory() from subinterpreter
#109894
Labels
3.12
bugs and security fixes
3.13
new features, bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
topic-subinterpreters
type-crash
A hard crash of the interpreter, possibly with a core dump
Comments
|
@chgnrdv are you able to reproduce on any earlier versions of Python, or is this just 3.13? A |
|
@AA-Turner , I've bisected this crash to feec49c, so 3.12 is affected too. |
chgnrdv
added a commit
to chgnrdv/cpython
that referenced
this issue
Oct 15, 2023
…erpreter Fixes python#109894 * set `interp.static_objects.last_resort_memory_error.args` to empty tuple to avoid crash on `PyErr_Display()` call * allow `_PyExc_InitGlobalObjects()` to be called on subinterpreter init
ericsnowcurrently
pushed a commit
that referenced
this issue
Oct 23, 2023
…er (gh-110911) Fixes #109894 * set `interp.static_objects.last_resort_memory_error.args` to empty tuple to avoid crash on `PyErr_Display()` call * allow `_PyExc_InitGlobalObjects()` to be called on subinterpreter init --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 23, 2023
…erpreter (pythongh-110911) Fixes pythonGH-109894 * set `interp.static_objects.last_resort_memory_error.args` to empty tuple to avoid crash on `PyErr_Display()` call * allow `_PyExc_InitGlobalObjects()` to be called on subinterpreter init --------- (cherry picked from commit 47d3e2e) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
ericsnowcurrently
pushed a commit
that referenced
this issue
Nov 28, 2023
…terpreter (gh-110911) (gh-111238) Fixes GH-109894 * set `interp.static_objects.last_resort_memory_error.args` to empty tuple to avoid crash on `PyErr_Display()` call * allow `_PyExc_InitGlobalObjects()` to be called on subinterpreter init --------- (cherry picked from commit 47d3e2e) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
aisk
pushed a commit
to aisk/cpython
that referenced
this issue
Feb 11, 2024
…erpreter (pythongh-110911) Fixes python#109894 * set `interp.static_objects.last_resort_memory_error.args` to empty tuple to avoid crash on `PyErr_Display()` call * allow `_PyExc_InitGlobalObjects()` to be called on subinterpreter init --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.12
bugs and security fixes
3.13
new features, bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
topic-subinterpreters
type-crash
A hard crash of the interpreter, possibly with a core dump
Crash report
What happened?
Repro:
Backtrace:
I can see two simultaneous reasons for this behaviour:
interp.exc_state.memerrors_freelistremains equal toNULL, which means thatPyErr_NoMemory()always returnsinterp.static_objects.last_resort_memory_error.interp.static_objects.last_resort_memory_errorhasargsfield equal toNULL, thus attempt to print it segfaults.Possible fix:
interp.static_objects.last_resort_memory_error.argsto empty tuple:_PyExc_InitGlobalObjects()or whateverCPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.13.0a0 (heads/main:e81bd3fa16, Sep 26 2023, 12:14:51) [GCC 10.2.1 20210110]
Linked PRs
MemoryErrorin subinterpreter #110911MemoryErrorin subinterpreter (gh-110911) #111238The text was updated successfully, but these errors were encountered: