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 — Free-threaded GC can abort during concurrent subinterpreter teardown · Issue #161751 · python/cpython Open Labels interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump DescriptionCrash reportOpTree CI hit this assertion on an unmodified Windows x64 free-threaded debug build of CPython 3.14.10 ( CI backtrace: https://github.com/metaopt/optree/actions/runs/42811376193/job/129813367183#step:18:1 I suspect a race in the abandoned-segment scan introduced with the mimalloc 2.5.2 update. One interpreter can temporarily clear a segment’s bitmap bit, discover that the segment belongs to another interpreter, and restore the bit. The owning interpreter’s GC reads the bitmap before acquiring Allocator code: https://github.com/python/cpython/blob/v3.14.10/Objects/mimalloc/arena-abandon.c#L209-L269 Standard Library ReproducerStarting from if (segment->subproc != subproc) {
+ usleep(100);
// it is from another sub-process, re-mark it and continue searchingBuild with from concurrent import interpreters from concurrent.futures import ThreadPoolExecutor from threading import Barrier workers = 8 barrier = Barrier(workers) def run(_worker_id): for _ in range(10): interp = interpreters.create() barrier.wait() interp.exec('import gc\ngc.collect()') interp.close() with ThreadPoolExecutor(workers) as pool: list(pool.map(run, range(workers))) With the timing change, this reduced case aborted in As a control, I kept the delay and moved lock acquisition ahead of the first bitmap read for full scans ( CPython versions tested on:3.14 Operating systems tested on:macOS Output from running 'python -VV' on the command line:No response Activity
MetadataMetadataAssigneesLabelsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump ProjectsMilestoneRelationshipsDevelopmentIssue 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. |