Many places have missing `PyErr_NoMemory()` call after failing memory allocation
未关闭
@sobolevn 已经在做这个了。
开始于 2026年6月9日。
interpreter-core
type-crash
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
Crash report
remove_unused_constsinPython/flowgraph.c
When PyMem_Malloc(nconsts * sizeof(Py_ssize_t)); fails, we need to set an exception.
gethandlelistandgetattributelistin_winapi.c
This place misses it:
All other error paths set exceptions, except this if:
_channelends_newinModules/_interpchannelsmodule.c
Later we check for errors in handle_channel_error, it requires either setting err to non -1 or to set Python exception. Both are false, it fails with the assertion failure.
Linked PRs
- gh-151127
- gh-151134
- gh-151135
- gh-151136
- gh-151137
- gh-151154
- gh-151180
- gh-151181
- gh-151182
- gh-151239
- gh-151265
- gh-151266
- gh-151336
- gh-151338
- gh-151339
- gh-151360
- gh-151361
- gh-151362
- gh-151382
- gh-151398
- gh-151399
- gh-151400
- gh-151580
- gh-151582
- gh-151588
- gh-151590
- gh-151624
- gh-151639
- gh-152014
- gh-152015
- gh-152016
- gh-152169
- gh-152170
- gh-152177
- gh-152179
- gh-152180
- gh-152181
- gh-152182
- gh-152183
- gh-152184
- gh-152418
- gh-152420
- gh-152421
- gh-152422
- gh-152478
- gh-152677
- gh-152678
- gh-152720
- gh-153215
- gh-153708
- gh-153709
- gh-153710
- gh-153765
- gh-156292
- gh-156299
- gh-156301
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。