Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-116510: Fix a Crash Due to Shared Immortal Interned Strings#124865
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2491,6 +2491,24 @@ _Py_ResurrectReference(PyObject *op) | ||
| #ifdef Py_TRACE_REFS | ||
| /* Make sure the ref is associated with the right interpreter. | ||
| * This only needs special attention for heap-allocated objects | ||
| * that have been immortalized, and only when the object might | ||
| * outlive the interpreter where it was created. That means the | ||
| * object was necessarily created using a global allocator | ||
| * (i.e. from the main interpreter). Thus in that specific case | ||
| * we move the object over to the main interpreter's refchain. | ||
| * | ||
| * This was added for the sake of the immortal interned strings, | ||
| * where legacy subinterpreters share the main interpreter's | ||
| * interned dict (and allocator), and therefore the strings can | ||
| * outlive the subinterpreter. | ||
| * | ||
| * It may make sense to fold this into _Py_SetImmortalUntracked(), | ||
| * but that requires further investigation. In the meantime, it is | ||
| * up to the caller to know if this is needed. There should be | ||
| * very few cases. | ||
| */ | ||
| void | ||
| _Py_NormalizeImmortalReference(PyObject *op) | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Having some comment here would be helpful. Otherwise this function looks quite mysterious. MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. done! | ||
| { | ||