python / python/cpython

test_tracemalloc: test_tracemalloc_track_race() crashs on GHA iOS CI

未关闭
#150,485 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

interpreter-core OS-android OS-ios tests type-crash
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

Crash report

iOS: https://github.com/python/cpython/actions/runs/26457870719/job/77897032289?pr=150441

This issue is likely the same as issue gh-143143, but I'm not 100% sure so I created a separated issue.

    0:11:19 load avg: 2.79 [435/505] test_tracemalloc
  Fatal Python error: Segmentation fault
  
  Current thread 0x0000000322193000 (most recent call first):
  
  Thread 0x0000000321187000 (most recent call first):
  
  Thread 0x000000032017b000 (most recent call first):
  
  (...)
  
  Thread 0x00000003100bb000 (most recent call first):
  
  <freed thread state>
  
  Current thread's C stack trace (most recent call first):
    Binary file "/Users/runner/work/cpython/cpython/cross-build/iOS-testbed.1779809388208/DerivedData/Build/Products/Debug-iphonesimulator/Python.framework/Python", at _Py_DumpStack+0x44 [0x102407804]
    Binary file "/Users/runner/work/cpython/cpython/cross-build/iOS-testbed.1779809388208/DerivedData/Build/Products/Debug-iphonesimulator/Python.framework/Python", at faulthandler_fatal_error+0x264 [0x10241e4a0]
    Binary file "/usr/lib/system/libsystem_platform.dylib", at _sigtramp+0x34 [0x100a6f7e0]
    Binary file "/Users/runner/work/cpython/cpython/cross-build/iOS-testbed.1779809388208/DerivedData/Build/Products/Debug-iphonesimulator/Python.framework/Python", at PyGILState_Ensure+0xf8 [0x1023eab50]
    Binary file "/Users/runner/work/cpython/cpython/cross-build/iOS-testbed.1779809388208/DerivedData/Build/Products/Debug-iphonesimulator/Python.framework/Python", at PyGILState_Ensure+0xf8 [0x1023eab50]
    Binary file "/Users/runner/work/cpython/cpython/cross-build/iOS-testbed.1779809388208/DerivedData/Build/Products/Debug-iphonesimulator/Python.framework/Python", at tracemalloc_alloc+0xa8 [0x1024097a4]
    Binary file "/Users/runner/work/cpython/cpython/cross-build/iOS-testbed.1779809388208/DerivedData/Build/Products/Debug-iphonesimulator/Python.framework/Python", at PyGILState_Ensure+0x58 [0x1023eaab0]
    Binary file "/Users/runner/work/cpython/cpython/cross-build/iOS-testbed.1779809388208/DerivedData/Build/Products/Debug-iphonesimulator/Python.framework/Python", at PyTraceMalloc_Track+0x34 [0x1024088ec]
    Binary file "/Users/runner/Library/Developer/CoreSimulator/Devices/D3F1CE55-196D-4DC8-9D1F-6D2D3AB3D118/data/Containers/Bundle/Application/130788EC-7B24-4534-8FF0-89C57EC65B80/iOSTestbed.app/Frameworks/_testcapi.framework/_testcapi", at tracemalloc_track_race_thread+0x20 [0x106f251b0]
    (...)
  
  Extension modules: _testcapi, _testinternalcapi, _testlimitedcapi, _testmultiphase, _testbuffer, _ctypes_test, xxsubtype, _testsinglephase_basic_wrapper, _testsinglephase_basic_copy, _testsinglephase_with_reinit, _testsinglephase_with_state, _test_non_isolated, _test_shared_gil_only, _test_no_multiple_interpreter_slot, _testsinglephase (total: 15)
  
  Restarting after unexpected exit, crash, or test timeout in -[TestbedTests testPython]; summary will include totals from previous launches.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 test_tracemalloc_track_race() 开始,复现链接的 iOS GitHub Actions 作业中的崩溃。将该失败与 issue gh-143143 进行比较,并检查报告中的 PyGILState_Ensure、tracemalloc_alloc 和 PyTraceMalloc_Track 堆栈帧。竞态不再导致 iOS testbed 崩溃且 test_tracemalloc 通过后,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
github-actions, ios, python
领域
ci-cd, operating-systems, testing-qa
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。