mirror of
https://github.com/python/cpython.git
synced 2025-08-27 20:25:18 +00:00
[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (#107751)
* Unrevert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)".
This reverts commit 6e4eec7606
(gh-107648).
* Initialize each interpreter's refchain properly.
* Skip test_basic_multiple_interpreters_deleted_no_reset on tracerefs builds.
This commit is contained in:
parent
bd2ef82a50
commit
aa9707dda9
8 changed files with 93 additions and 30 deletions
|
@ -1920,11 +1920,11 @@ Py_FinalizeEx(void)
|
|||
}
|
||||
|
||||
if (dump_refs) {
|
||||
_Py_PrintReferences(stderr);
|
||||
_Py_PrintReferences(tstate->interp, stderr);
|
||||
}
|
||||
|
||||
if (dump_refs_fp != NULL) {
|
||||
_Py_PrintReferences(dump_refs_fp);
|
||||
_Py_PrintReferences(tstate->interp, dump_refs_fp);
|
||||
}
|
||||
#endif /* Py_TRACE_REFS */
|
||||
|
||||
|
@ -1960,11 +1960,11 @@ Py_FinalizeEx(void)
|
|||
*/
|
||||
|
||||
if (dump_refs) {
|
||||
_Py_PrintReferenceAddresses(stderr);
|
||||
_Py_PrintReferenceAddresses(tstate->interp, stderr);
|
||||
}
|
||||
|
||||
if (dump_refs_fp != NULL) {
|
||||
_Py_PrintReferenceAddresses(dump_refs_fp);
|
||||
_Py_PrintReferenceAddresses(tstate->interp, dump_refs_fp);
|
||||
fclose(dump_refs_fp);
|
||||
}
|
||||
#endif /* Py_TRACE_REFS */
|
||||
|
@ -2074,6 +2074,8 @@ new_interpreter(PyThreadState **tstate_p, const PyInterpreterConfig *config)
|
|||
}
|
||||
has_gil = 1;
|
||||
|
||||
/* No objects have been created yet. */
|
||||
|
||||
status = pycore_interp_init(tstate);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
goto error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue