python / python/cpython

`test_free_threading.test_gc.TestGC.test_get_referrers` can segfault

オープン
#153,777 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

tests topic-free-threading type-crash
主要言語
Python
スター
77.2k
フォーク
35.9k
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. リポジトリをフォークし、ブランチを切って変更します。
  4. 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 を短くまとめたダイジェスト。