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-115649: Fix double free for intern strings dict by aisk · Pull Request #120290 · python/cpython Conversation
|
| PyDict_Clear(interned); | ||
| Py_DECREF(interned); | ||
| _Py_INTERP_CACHED_OBJECT(interp, interned_strings) = NULL; | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If I understand the crash report correctly, the problem is that the interned dict is cleared for sub-interpreters when it is also shared between the main interpreter and sub-interpreters. This change means that PyDict_Clear() is never called, not even for the main interpreter. That seems like it will just leak everything in the dict.
I imagine, rather, that you'd put this code inside the block below that is guarded by the _Py_IsMainInterpreter() checl.
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.
Thanks for the review! Sorry, I put this PR too earlier, after some research I found that I was wrong, and the crash is caused by other place.
For now I can ensure that this line
Line 1973 in 34f5ae6
| PyUnicode_InternInPlace(&filename); |
_tkinter.so, and after the interned dict finalization, call free on this object will crash.
I guess maybe this unicode object is created in another interpreter, and intern it in the main interpreter will cause the error. But I'm not familiar with these code, and still working on it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closed by #120315 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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.