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
Free lists are still used after being finalized (cleared) #85064
Comments
I'm opening a separate issue to prevent bpo-40521 from getting too big. Lists and tuples sometimes leak (starting 69ac6e5 and later): ==1445== 56 bytes in 1 blocks are definitely lost in loss record 1,542 of 4,898 ==1445== 64 bytes in 1 blocks are definitely lost in loss record 2,259 of 4,898 |
It's not a regression. It's just that bpo-40521 helped Valgrind to detect such bug :-) I wrote bpo-20698 to fix this issue. I'm also working on a more generic approach to ensure that we don't add new objects to free lists after free lists are cleared. |
I'm curious about this bug, so I looked at code changes. Before Python 3.6, warnings.c "garbage" is declared as a static variable. It is initialized once but never cleared. In Python 3.7, the variable moved into _PyRuntimeState.gc. In Python 3.8, _PyGC_Fini() started to clear the "garbage" list. This function is called by Py_FinalizeEx() *after* PyList_Fini(). |
Thanks Stefan for the bug report. It's now fixed and I made sure that such bug cannot strike back. |
Yes, I suspected that previously reachable global objects were just unreachable after the new free lists. Thanks for the fix! |
All free lists now have assertions to ensure that they are no longer used after their finalization. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: