pylifecycle.c: Multiple init/fini cleanup bugs
未關閉
還沒有人認領這個 Issue。
interpreter-core
type-bug
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 35.9k
- PR 合併指標
- PR 指標待擷取
描述
Bug report
Bug description:
Parent: https://github.com/python/cpython/issues/146102
https://gist.github.com/devdanzin/b022ff2d1304a4b2b8d3d8750abd8da5
pylifecycle.c: Multiple init/fini cleanup bugs
Summary
5 bugs in interpreter lifecycle:
- new_interpreter (line 2534):
return statusbypasses switch-back aftersave_tstatedetach → thread state corruption. - pycore_init_builtins (line 860): Direct
returnleaksbimodref. - add_main_module (line 2762):
bimod/loaderrefs leaked onPyDict_SetItemStringfailure. - finalize_clear_modules_dict (line 1685): Return value of
PyObject_CallMethodNoArgsnever DECREF'd. - init_sys_streams (line 3019-3031): Unchecked
PySys_SetObjectfor stdin/stdout (stderr correctly checked).
CPython versions tested on:
CPython main branch, 3.15
Operating systems tested on:
No response
Linked PRs
- gh-149631
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先從父 issue 和連結的 gist 開始,然後檢查 pylifecycle.c 中的 new_interpreter、pycore_init_builtins、add_main_module、finalize_clear_modules_dict 和 init_sys_streams。檢查每條回報的失敗路徑,並使用連結的 PR gh-149631 了解現有內容。完成標準是處理好全部五個 lifecycle 清理問題,同時不引入新的參照或 thread-state 問題。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- c, python
- 領域
- compilers
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100