Commit 87e7cb0
authored
A static (process-global) str object must only have its "interned" state cleared when no longer interned in any interpreters. They are the only ones that can be shared by interpreters so we don't have to worry about any other str objects.
We trigger clearing the state with the main interpreter, since no other interpreters may exist at that point and _PyUnicode_ClearInterned() is only called during interpreter finalization.
We do not address here the fact that a string will only be interned in the first interpreter that interns it. In any subsequent interpreters str.state.interned is already set so _PyUnicode_InternInPlace() will skip it. That needs to be addressed separately from fixing the crasher.
1 parent fd84ac0 commit 87e7cb0
File tree
2 files changed
+15
-1
lines changed- Misc/NEWS.d/next/Core and Builtins
- Objects
2 files changed
+15
-1
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14818 | 14818 | | |
14819 | 14819 | | |
14820 | 14820 | | |
| 14821 | + | |
14821 | 14822 | | |
14822 | 14823 | | |
14823 | 14824 | | |
| |||
14829 | 14830 | | |
14830 | 14831 | | |
14831 | 14832 | | |
| 14833 | + | |
| 14834 | + | |
| 14835 | + | |
| 14836 | + | |
| 14837 | + | |
| 14838 | + | |
| 14839 | + | |
| 14840 | + | |
14832 | 14841 | | |
14833 | 14842 | | |
14834 | 14843 | | |
| |||
14837 | 14846 | | |
14838 | 14847 | | |
14839 | 14848 | | |
14840 | | - | |
| 14849 | + | |
| 14850 | + | |
| 14851 | + | |
14841 | 14852 | | |
14842 | 14853 | | |
14843 | 14854 | | |
| |||
0 commit comments