-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Open
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
Crash report
What happened?
The following code runs a subinterpreter in a new non-daemon thread, where CTRL+C+C interruption causes an assertion failure on debug builds:
from concurrent import interpreters
def f():
import time
time.sleep(100)
if __name__ == '__main__':
interp = interpreters.create()
print('press CTRL^C twice:')
t = interp.call_in_thread(f)
t.join()
Assertion failed: !_PyInterpreterState_IsRunningMain(interp), file C:\rc\Python\pylifecycle.c, line 2516
The same assert can be triggered without keystrokes:
import threading
from concurrent import interpreters
interp = interpreters.create()
t = threading.Thread(target=interp.exec, daemon=True,
args=('import time; time.sleep(3)',))
t.start()
CPython versions tested on:
3.14.0rc1, CPython main branch: 2a87af0
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Projects
Status
Todo