GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Multithreaded subinterpreters can be running during finalization · Issue #126016 · python/cpython Closed Labels 3.13only security fixesonly security fixes3.14bugs and security fixesbugs 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 DescriptionCrash reportWhat happened?(Found while investigating a fix for #125920.) Subinterpreters that are running in a different thread can still be running upon the finalization of the main interpreter, depending on what the thread was doing. Take the following script: from threading import Thread import _interpreters def silly(): interp = _interpreters.create() _interpreters.run_string(interp, "import time; time.sleep(100)") if __name__ == "__main__": Thread(target=silly).start() On 3.13 and 3.14, killing the process with CTRL+C results in an assertion failure: However, if the thread is daemon, then the interpreter fully segfaults: from threading import Thread import _interpreters def silly(): interp = _interpreters.create() _interpreters.run_string(interp, "import time; time.sleep(100)") if __name__ == "__main__": Thread(target=silly, daemon=True).start() I'm going to investigate possible fixes. CPython versions tested on:3.13, CPython main branch Operating systems tested on:Linux Output from running 'python -VV' on the command line:No response Linked PRsActivity
MetadataMetadataAssigneesLabels3.13only security fixesonly security fixes3.14bugs and security fixesbugs 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
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |