GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters by ericsnowcurrently · Pull Request #107567 · python/cpython Conversation
|
| } | ||
|
|
||
| PyObject refchain = { 0 }; | ||
| _Py_StealRefchain(tstate->interp, &refchain); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The interpreter will be deallocated before we later call _Py_PrintReferenceAddresses() to walk the linked list.
That said, I think there's a related problem that I still need to address. Namely, every remaining object in the linked list will be (effectively) freed when the interpreter's allocator is finalized, so the _ob_next and _ob_prev accesses might segfault. It likely isn't a big problem during runtime finalization (except perhaps for embedders) but I'll fix that regardless.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm pretty sure that's not actually a problem. We only call _Py_PrintReferenceAddresses() in Py_FinalizeEx() and only for the main interpreter, which is statically allocated. Objects in the linked list might still cause a segfault but only if they would have before this change, so I'm not going to worry about that here. I will leave a note in the code though.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @ericsnowcurrently for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-107599 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ters (pythongh-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 58ef741) Co-authored-by: Eric Snow <[email protected]>
…eters (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 58ef741) Co-authored-by: Eric Snow <[email protected]>
…ted Subinterpreters (pythongh-107567) (python#107599)" This reverts commit 58af229.
…lated Subinterpreters (pythongh-107567) (python#107599)". This reverts commit 6e4eec7 (pythongh-107648).
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.