Crash report
What happened?
It's possible to abort the interpreter by calling multiprocessing.shared_memory.ShareableList.count in threads with PYTHON_GIL=0 in a debug build:
importgcimportmultiprocessing.shared_memoryfromthreadingimportThreadobj=multiprocessing.shared_memory.ShareableList("Uq..SeDAmB+EBrkLl.SG.Z+Z.ZdsV..wT+zLxKwdN\b")
forxinrange(10):
Thread(target=obj.count, args=(1,)).start()
delobjgc.collect()Result:
Exceptionignoredin: <functionSharedMemory.__del__at0x200006bbfb0>Traceback (mostrecentcalllast):
File"/home/danzin/projects/mycpython/Lib/multiprocessing/shared_memory.py", line189, in__del__self.close()
File"/home/danzin/projects/mycpython/Lib/multiprocessing/shared_memory.py", line229, incloseself._buf.release()
BufferError: memoryviewhas2exportedbufferspython: Objects/memoryobject.c:1143: memory_dealloc: Assertion `self->exports==0' failed.
Aborted
Found 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.0a2+ experimental free-threading build (heads/main-dirty:c9b399fbdb0, Nov 19 2024, 20:12:48) [GCC 11.4.0]
Linked PRs
Crash report
What happened?
It's possible to abort the interpreter by calling
multiprocessing.shared_memory.ShareableList.countin threads withPYTHON_GIL=0in a debug build:Result:
Found 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.0a2+ experimental free-threading build (heads/main-dirty:c9b399fbdb0, Nov 19 2024, 20:12:48) [GCC 11.4.0]
Linked PRs
memoryview->exportsrace condition. #127412