python / python/cpython

`test_free_threading.test_gc.TestGC.test_get_referrers` can segfault

未關閉
#153,777 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

tests topic-free-threading type-crash
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

Crash report

What happened?

See this Buildbot run:

test_get_referrers (test.test_free_threading.test_gc.TestGC.test_get_referrers) ... Fatal Python error: Segmentation fault
<Cannot show all threads while the GIL is disabled>
Stack (most recent call first):
  File "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/Lib/test/test_free_threading/test_gc.py", line 50 in gc_thread
  File "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/Lib/threading.py", line 1160 in run
  File "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/Lib/threading.py", line 1218 in _bootstrap_inner
  File "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/Lib/threading.py", line 1180 in _bootstrap
Current thread's C stack trace (most recent call first):
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at _Py_DumpStack+0x3c [0x2ae5b7875a]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x32b280 [0x2ae5b92280]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x32b9a2 [0x2ae5b929a2]
  Binary file "linux-vdso.so.1", at __vdso_rt_sigreturn+0x0 [0x3fe789c800]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x1b1a0c [0x2ae5a18a0c]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at _PyType_GetDict+0xc [0x2ae5a1a6b4]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x181a9c [0x2ae59e8a9c]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at _Py_LoadAttr_StackRefSteal+0x5a [0x2ae5ac1388]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at _PyEval_EvalFrameDefault+0x100a6 [0x2ae5ad4a5c]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x2780b8 [0x2ae5adf0b8]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x278214 [0x2ae5adf214]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at _PyFunction_Vectorcall+0x48 [0x2ae59847ba]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x11da7c [0x2ae5984a7c]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x11e388 [0x2ae5985388]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x1203b0 [0x2ae59873b0]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x293470 [0x2ae5afa470]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x293914 [0x2ae5afa914]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at _PyCallMethodDescriptorFastWithKeywords_StackRef+0x54 [0x2ae5ac1aee]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at _PyEval_EvalFrameDefault+0x8262 [0x2ae5accc18]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x2780b8 [0x2ae5adf0b8]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x278214 [0x2ae5adf214]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at _PyFunction_Vectorcall+0x48 [0x2ae59847ba]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x11da7c [0x2ae5984a7c]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x11e388 [0x2ae5985388]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x1203b0 [0x2ae59873b0]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x11ed88 [0x2ae5985d88]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x11f0ac [0x2ae59860ac]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at PyObject_Call+0x1e [0x2ae59860de]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x38e73e [0x2ae5bf573e]
  Binary file "/var/lib/buildbot/workers/rise-riscv64-3/3.x.rise-riscv64-3.nogil/build/python", at +0x30e01e [0x2ae5b7501e]
  Binary file "/lib/riscv64-linux-gnu/libc.so.6", at +0x710da [0x3fe77080da]
  Binary file "/lib/riscv64-linux-gnu/libc.so.6", at +0xc38cc [0x3fe775a8cc]
  <truncated rest of calls>
Extension modules: _testcapi, _testinternalcapi (total: 2)
CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Output from running 'python -VV' on the command line:

No response

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 Lib/test/test_free_threading/test_gc.py 開始,特別查看第 50 行的 TestGC.test_get_referrers 和 gc_thread,然後使用 free-threading build 重現該測試,並與連結的 Buildbot 執行結果進行比較。沿著報告中的 _PyType_GetDict 路徑追蹤 segmentation fault;當該測試在受影響的 build 上不再發生 segmentation fault 時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
backend, testing-qa
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
需要釐清
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。