diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-08-03 22:18:29 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-03 22:18:29 (GMT) |
| commit | 58af2293c52a1ad3754d254690c0e54f787c545b (patch) | |
| tree | 3e6274e2d60af26d5d7669e52b1213c1db8602bb /Python/pylifecycle.c | |
| parent | d2c7b25afba3d86ee20331d9fb722a6fe1f768ac (diff) | |
| download | cpython-58af2293c52a1ad3754d254690c0e54f787c545b.zip cpython-58af2293c52a1ad3754d254690c0e54f787c545b.tar.gz cpython-58af2293c52a1ad3754d254690c0e54f787c545b.tar.bz2 | |
[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)
gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567)
The linked list of objects was a global variable, which broke isolation between interpreters, causing crashes. To solve this, we've moved the linked list to each interpreter.
(cherry picked from commit 58ef74186795c56e3ec86e8c8f351a1d7826638a)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Diffstat (limited to 'Python/pylifecycle.c')
| -rw-r--r-- | Python/pylifecycle.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index a67fa26..5b8c8af 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -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 */ |
