Skip to content

[Free Threading] _PyThreadState_ResumeDetached: Assertion `_Py_atomic_load_int_relaxed(&tstate->state) == _Py_THREAD_SUSPENDED' failed on AMD64 CentOS9 NoGIL Refleaks 3.15 #159373

Closed

Description

@vstinner

AMD64 CentOS9 NoGIL Refleaks 3.15: https://buildbot.python.org/#/builders/2078/builds/504

== CPython 3.15.0+dev free-threading build (heads/3.15:ed4f3bccbd4, Oct 13 2026, 16:45:47) [GCC 11.5.0 20240719 (Red Hat 11.5.0-15)]
== Linux-5.14.0-754.el9.x86_64-x86_64-with-glibc2.34 little-endian
== Python build: free_threading debug
== cwd: /home/buildbot/buildarea/3.15.itamaro-centos-aws.refleak.nogil/build/build/test_python_worker_2426764æ
== CPU count: 16
== encodings: locale=UTF-8 FS=utf-8
== resources: all,-cpu

Using random seed: 3516291342
0:00:00 load avg: 2.39 Run 558 tests in parallel using 10 worker processes (timeout: 45 min, worker timeout: 50 min)
0:00:00 load avg: 2.39 [  1/558] test_codeop passed
0:00:01 load avg: 2.39 [  2/558] test_named_expressions passed
0:00:01 load avg: 2.39 [  3/558] test_complex passed
...
0:08:01 load avg: 9.12 [384/558/52] test.test_gdb.test_jit passed -- running (3): test_traceback (31.2 sec), test_profiling (53.8 sec), test_pickle (1 min 1 sec)
0:08:01 load avg: 9.12 [385/558/52] test_unary passed -- running (3): test_traceback (31.6 sec), test_profiling (54.2 sec), test_pickle (1 min 1 sec)
python: Python/pystate.c:2404: _PyThreadState_ResumeDetached: Assertion `_Py_atomic_load_int_relaxed(&tstate->state) == _Py_THREAD_SUSPENDED' failed.
Fatal Python error: Aborted

<Cannot show all threads while the GIL is disabled>
Stack (most recent call first):
  File "/home/buildbot/buildarea/3.15.itamaro-centos-aws.refleak.nogil/build/Lib/test/libregrtest/run_workers.py", line 618 in run
  File "/home/buildbot/buildarea/3.15.itamaro-centos-aws.refleak.nogil/build/Lib/test/libregrtest/main.py", line 452 in _run_tests_mp
  File "/home/buildbot/buildarea/3.15.itamaro-centos-aws.refleak.nogil/build/Lib/test/libregrtest/main.py", line 558 in _run_tests
  File "/home/buildbot/buildarea/3.15.itamaro-centos-aws.refleak.nogil/build/Lib/test/libregrtest/main.py", line 595 in run_tests
  File "/home/buildbot/buildarea/3.15.itamaro-centos-aws.refleak.nogil/build/Lib/test/libregrtest/main.py", line 788 in main
  File "/home/buildbot/buildarea/3.15.itamaro-centos-aws.refleak.nogil/build/Lib/test/libregrtest/main.py", line 796 in main
  File "/home/buildbot/buildarea/3.15.itamaro-centos-aws.refleak.nogil/build/Lib/test/__main__.py", line 2 in <module>
  File "/home/buildbot/buildarea/3.15.itamaro-centos-aws.refleak.nogil/build/Lib/runpy.py", line 87 in _run_code
  File "/home/buildbot/buildarea/3.15.itamaro-centos-aws.refleak.nogil/build/Lib/runpy.py", line 201 in _run_module_as_main

Current thread's C stack trace (most recent call first):
  Binary file "./python", at _Py_DumpStack+0x31 [0x7881c6]
  Binary file "./python" [0x7aa8ae]
  Binary file "./python" [0x7aaaed]
  Binary file "/lib64/libc.so.6", at +0x3fb30 [0x7fdf4a23fb30]
  Binary file "/lib64/libc.so.6", at +0x8d34c [0x7fdf4a28d34c]
  Binary file "/lib64/libc.so.6", at raise+0x16 [0x7fdf4a23fa86]
  Binary file "/lib64/libc.so.6", at abort+0xd3 [0x7fdf4a229873]
  Binary file "/lib64/libc.so.6", at +0x2979b [0x7fdf4a22979b]
  Binary file "/lib64/libc.so.6", at +0x387c6 [0x7fdf4a2387c6]
  Binary file "./python", at PyThreadState_SetAsyncExc+0x0 [0x759e3c]
  Binary file "./python" [0x68d313]
  Binary file "./python" [0x565644]
  Binary file "./python", at _Py_DecRefSharedDebug+0x11 [0x564d14]
  Binary file "./python" [0x5b4ee3]
  Binary file "./python" [0x5b53aa]
  Binary file "./python", at _Py_Dealloc+0x13b [0x564b4c]
  Binary file "./python", at _Py_DecRefSharedDebug+0x23 [0x564d26]
  Binary file "./python" [0x68f064]
  Binary file "./python", at _PyEval_EvalFrameDefault+0x1f0d1 [0x6bae0c]
  Binary file "./python" [0x6bf333]
  Binary file "./python", at PyEval_EvalCode+0x23b [0x6bf576]
  Binary file "./python" [0x687e1f]
  Binary file "./python" [0x688167]
  Binary file "./python" [0x55b724]
  Binary file "./python" [0x4cce2c]
  Binary file "./python", at PyObject_Vectorcall+0x23 [0x4ccf29]
  Binary file "./python", at _Py_VectorCallInstrumentation_StackRefSteal+0xcf [0x69542f]
  Binary file "./python", at _PyEval_EvalFrameDefault+0x51a0 [0x6a0edb]
  Binary file "./python" [0x6bf333]
  Binary file "./python", at _PyFunction_Vectorcall+0x51 [0x4cc8cd]
  Binary file "./python" [0x4cfa0c]
  Binary file "./python" [0x4cfcea]
  <truncated rest of calls>
make: *** [Makefile:2557: buildbottest] Aborted (core dumped)
program finished with exit code 2

Activity

  1. added
    interpreter-core
    on Oct 13, 2026
  2. vstinner commented on Oct 13, 2026

    @vstinner
    MemberAuthor

    cc @nascheme

    Oh, maybe the assertion was fixed by the following 3.15 change: commit ef498e0

    commit ef498e03366065319d57c1ce65e1d7bdcefbb498 (upstream/3.15, 3.15)
    Author: Neil Schemenauer <[email protected]>
    Date:   Tue Oct 13 12:43:19 2026 -0700
    
        [3.15] Fix _PyThreadState_ResumeDetached() assertion with attach waiters (GH-159372)
        
        Make _PyThreadState_ResumeDetached() waiter-aware and use it from
        start_the_world(), matching main branch.  Remove tstate_resume().
    
  3. nascheme commented on Oct 13, 2026

    @nascheme
    Member

    Yup, that commit should fix it. I expect it was caused by a bad squash merge for GH-158186.

  4. vstinner commented on Oct 14, 2026

    @vstinner
    MemberAuthor

    Yup, that commit should fix it. I expect it was caused by a bad squash merge for #158186.

    Ok.

    AMD64 CentOS9 NoGIL Refleaks 3.15: https://buildbot.python.org/#/builders/2078/builds/504

    The 3 following builds were successful. I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-coretopic-free-threading

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions