Skip to content

gh-152156: Fix a crash in interpeters.create under limited memory conditions#152163

Open
sobolevn wants to merge 1 commit into
python:mainfrom
sobolevn:issue-152156
Open

gh-152156: Fix a crash in interpeters.create under limited memory conditions#152163
sobolevn wants to merge 1 commit into
python:mainfrom
sobolevn:issue-152156

Conversation

@sobolevn

@sobolevn sobolevn commented Jun 25, 2026

Copy link
Copy Markdown
Member

In handle_channel_error we already set an error. When called the second time, we get end up with err == 0 and run this code:

if (err == 0) {
    assert(!PyErr_Occurred());
    return 0;
}

which will fail, because exception was already set by the first error. So, there's no need to call it twice.

@serhiy-storchaka

Copy link
Copy Markdown
Member

Are you sure that channel_destroy can not clear error?

@sobolevn

Copy link
Copy Markdown
Member Author

PyErr_Clear can be called in _release_xid_data under XID_IGNORE_EXC, but it resets the previous error correctly. I don't see any real ways to clear it.

PyErr_GetRaisedException and PyErr_Clear are only used in _release_xid_data in this path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants