Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Crash when free-threaded Python is built with--with-trace-refs #124043

Closed
Labels
stdlibStandard Library Python modules in the Lib/ directorytopic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dump
@XuehaiPan

Description

@XuehaiPan

Crash report

What happened?

I'm usingThreadPoolExecutor to write tests for free-threading enabled C extensions.

When running concurrent threads larger thannum_workers, CPython crashes. CPython crashes whennum_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

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp