-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
test_audit_subinterpreter crashes with tracerefs enabled #125286
Comments
This bug was introduced by gh-124865. My analysis of the issue is that the tracerefs debugging logic gets confused when objects are shared between sub-interpreters. E.g. I'm not sure why interned strings are the only thing causing trace-refs failures. I would guess that other objects should also cause an issue since |
Indeed, it does seem possible to crash with shared objects other than strings. You just have to initialize in the right way and then finalize in the right order. https://github.com/nascheme/cpython/tree/test_single_phase_shared |
They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds. Co-authored-by: Petr Viktorin <[email protected]>
…ers (pythongh-125709) They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds.
…gh-124865) (gh-125709) (GH-125204) * gh-116510: Fix a Crash Due to Shared Immortal Interned Strings (gh-124865) Fix a crash caused by immortal interned strings being shared between sub-interpreters that use basic single-phase init. In that case, the string can be used by an interpreter that outlives the interpreter that created and interned it. For interpreters that share obmalloc state, also share the interned dict with the main interpreter. This is an un-revert of gh-124646 that then addresses the Py_TRACE_REFS failures identified by gh-124785. (cherry picked from commit f2cb399) Co-authored-by: Eric Snow <[email protected]> * [3.13] gh-125286: Share the Main Refchain With Legacy Interpreters (gh-125709) They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds. --------- Co-authored-by: Eric Snow <[email protected]>
…ers (pythongh-125709) They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds.
…thongh-125709) They used to be shared, before 3.12. Returning to sharing them resolves a failure on Py_TRACE_REFS builds. Co-authored-by: Petr Viktorin <[email protected]>
Crash report
What happened?
To run test:
Programs/_testembed test_audit_subinterpreter
.The program crashes with an assert failure:
Stack trace:
The object is a string that has been interned but not immortalized. Likely it is shared between sub-interpreters, using basic single-phase init and is therefore shared between multiple sub-interpreters.
The value of
_PyRefchain_IsTraced()
is false since it is ref-traced in a different interpreter.Quick and dirty fix for the crash:
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: