Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Crash report
What happened?
I'm usingThreadPoolExecutor to write tests for free-threading enabled C extensions.
When running concurrent threads larger than CPython crashes whennum_workers, CPython crashes.num_futures >= 2 if the test function is complex enough.
The Python is installed via the following configuration with PyDebug enabled:
./configure --prefix="${PWD}/pydev" \ --enable-ipv6 --with-openssl="$(brew --prefix openssl)" \ --with-system-expat --with-system-libmpdec \ --with-assertions --with-pydebug --with-trace-refs \ --disable-gil
fromconcurrent.futuresimportThreadPoolExecutorNUM_WORKERS=32NUM_FUTURES=1024defconcurrent_run(func):withThreadPoolExecutor(max_workers=NUM_WORKERS)asexecutor:for_inrange(NUM_FUTURES):executor.submit(func)concurrent_run(lambda :None)
Python3.13.0rc2+experimentalfree-threadingbuild (heads/3.13:112b1704fa6,Sep132024,15:34:48) [Clang15.0.0 (clang-1500.3.9.4)]ondarwinType"help","copyright","credits"or"license"formoreinformation.>>>fromconcurrent.futuresimportThreadPoolExecutor>>>NUM_WORKERS=32...NUM_FUTURES=1024... ...defconcurrent_run(func):...withThreadPoolExecutor(max_workers=NUM_WORKERS)asexecutor:...for _inrange(NUM_FUTURES):...executor.submit(func)...>>>concurrent_run(lambda :None)Assertionfailed: (value==REFCHAIN_VALUE),function_PyRefchain_Remove,fileobject.c,line195.FatalPythonerror:AbortedThread0x0000000173e2b000 (mostrecentcallfirst):File"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line304in__enter__File"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line528inreleaseFile"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/concurrent/futures/thread.py",line87in_workerFile"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line992inrunFile"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line1041in_bootstrap_innerFile"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line1012in_bootstrapThread0x0000000172e1f000 (mostrecentcallfirst):File"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/concurrent/futures/thread.py",line89in_workerFile"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line992inrunFile"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line1041in_bootstrap_innerFile"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line1012in_bootstrapThread0x0000000171e13000 (mostrecentcallfirst):File"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/concurrent/futures/thread.py",line89in_workerFile"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line992inrunFile"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line1041in_bootstrap_innerFile"/Users/PanXuehai/Projects/cpython/pydev/lib/python3.13t/threading.py",line1012in_bootstrapCurrentthread0x0000000170e07000 (mostrecentcallfirst):Assertionfailed: (PyCode_Check(f->f_executable)),function_PyFrame_GetCode,filepycore_frame.h,line81.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Output from running 'python -VV' on the command line:
Python 3.13.0rc2+ experimental free-threading build (heads/3.13:112b1704fa6, Sep 13 2024, 15:34:48) [Clang 15.0.0 (clang-1500.3.9.4)]
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done