-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-128639: Don't assume one thread in subinterpreter finalization #128640
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
Changes from 13 commits
025cc17
eea3ba9
149e0cf
1761c37
8febfbf
5a73ce1
a7cc3fe
7c44c0b
6551bfa
f19e28d
02da72a
a759540
76e4ec9
1555731
d61099e
09851dc
b223396
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix a crash when using threads inside of a subinterpreter. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1424,9 +1424,12 @@ static int test_audit_subinterpreter(void) | |
PySys_AddAuditHook(_audit_subinterpreter_hook, NULL); | ||
_testembed_Py_InitializeFromConfig(); | ||
|
||
Py_NewInterpreter(); | ||
Py_NewInterpreter(); | ||
Py_NewInterpreter(); | ||
PyThreadState *tstate = PyThreadState_Get(); | ||
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. I think this test working before was a fluke. 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. It's probably okay but your change helps future-proof the test. |
||
for (int i = 0; i < 3; ++i) | ||
{ | ||
Py_EndInterpreter(Py_NewInterpreter()); | ||
PyThreadState_Swap(tstate); | ||
} | ||
|
||
Py_Finalize(); | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.