Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Closed
Closed
Copy link
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesinterpreter-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
Description
What happened?
The code below, in a no-gil debug build with PYTHON_GIL=0, results in the following abort:
python: ./Include/internal/pycore_stackref.h:99: _PyStackRef_FromPyObjectSteal: Assertion `obj != NULL' failed. Aborted fromthreadingimportThreadfromcollectionsimportChainMap, Countercounter=Counter(range(100)) chainmap=ChainMap(counter) chainmap2=ChainMap(counter) defmutate_removing(): forxinrange(10): chainmap.pop(list(chainmap.keys()).pop()) chainmap2.pop(list(chainmap2.keys()).pop()) defmutate_adding(): forxinrange(50): chainmap[max(chainmap) +x+1] =xchainmap2[max(chainmap2) +x+1] =xalive= [] forxinrange(55): alive.append(Thread(target=mutate_removing, args=())) alive.append(Thread(target=mutate_adding, args=())) forobjinalive: try: print('START', obj) obj.start() exceptException: passFound using fusil by @vstinner.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.14.0a1+ experimental free-threading build (heads/main:556dc9b8a7, Nov 3 2024, 10:09:47) [GCC 11.4.0]
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesinterpreter-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