Commit 7264c6d
pythongh-105699: Fix a Crasher Related to a Deprecated Global Variable (pythongh-106923)
There was a slight race in _Py_ClearFileSystemEncoding() (when called from _Py_SetFileSystemEncoding()), between freeing the value and setting the variable to NULL, which occasionally caused crashes when multiple isolated interpreters were used. (Notably, I saw at least 10 different, seemingly unrelated spooky-action-at-a-distance, ways this crashed. Yay, free threading!) We avoid the problem by only setting the global variables with the main interpreter (i.e. runtime init).
(cherry picked from commit 0ba07b2)
Co-authored-by: Eric Snow <[email protected]>1 parent ffc7678 commit 7264c6d
File tree
2 files changed
+11
-4
lines changed- Misc/NEWS.d/next/Core and Builtins
- Objects
2 files changed
+11
-4
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15177 | 15177 | | |
15178 | 15178 | | |
15179 | 15179 | | |
15180 | | - | |
15181 | | - | |
15182 | | - | |
15183 | | - | |
| 15180 | + | |
| 15181 | + | |
| 15182 | + | |
| 15183 | + | |
| 15184 | + | |
| 15185 | + | |
| 15186 | + | |
15184 | 15187 | | |
15185 | 15188 | | |
15186 | 15189 | | |
| |||
0 commit comments