-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-113190: Reenable non-debug interned string cleanup #113601
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
Merged
encukou
merged 19 commits into
python:main
from
eduardo-elizondo:reenable_unicode_clear_interned
Aug 15, 2024
Merged
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
666ca33
Reenable non-debug interned string cleanup through _PyUnicode_ClearIn…
eduardo-elizondo 23d1aff
Revert test changes due to previously leftover leaks
eduardo-elizondo fd9c7ff
Merge remote-tracking branch 'upstream/main' into reenable_unicode_cl…
eduardo-elizondo ed09466
Add documentation
eduardo-elizondo 2608119
Lint docs
eduardo-elizondo 17e8817
Lint docs v2
eduardo-elizondo dd1e8b4
Lint docs v3
eduardo-elizondo ce5536b
Lint docs v4
eduardo-elizondo 071438f
Lint docs v5
eduardo-elizondo afc7c1d
Lint docs v6
eduardo-elizondo 2ec1326
Lint docs v7
eduardo-elizondo e8b9b45
Lint docs v8
eduardo-elizondo 175bc40
Lint docs v9
eduardo-elizondo ffe9d03
Fix NEWS message
eduardo-elizondo 085b93e
Merge in the main branch
encukou 080a853
Remove outdated comment
encukou 8484c4b
Merge remote-tracking branch 'upstream/main' into reenable_unicode_cl…
eduardo-elizondo 6aee7f5
Addressed Comments
eduardo-elizondo dc3b54f
Update whatsnew
encukou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Misc/NEWS.d/next/Core and Builtins/2024-01-15-18-11-48.gh-issue-113190.OwQX64.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
This updates the interned string deallocation function | ||
``_PyUnicode_ClearInterned`` to delete all interned strings during runtime | ||
finalization when calling ``Py_Finalize``, regardless of their reference | ||
count. | ||
|
||
Worth noting that if an extension accidentally holds onto a interned string, | ||
event after calling Py_Finalize, it will result in use-after-free error, | ||
leaving the user to a potential vulnerabilities. That said, the history of | ||
how these interned strings are handled have been changing during throughout | ||
different versions. | ||
|
||
For example, in Python 3.9 and older, interned strings were never deleted. | ||
Only special builds for Valgrind and Purity cleared them at exit. In Python | ||
3.10 and 3.11, interned strings are always deleted at exit. In Python 3.12, | ||
interned strings are deleted only if Python is built in debug mode: they | ||
are not deleted in release mode. In Python 3.13, interned strings will | ||
now be all deleted. | ||
|
||
Given how the guarantees changed throughout different versions, it is not | ||
expected that users actively rely on this behavior for their extensions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.