Skip to content

gh-162156: Fix MemoryError being ignored in subinterpreters - #162157

Open
aisk wants to merge 2 commits into
python:mainfrom
aisk:xi-memoryerror-swallowed
Open

aisk wants to merge 2 commits into
python:mainfrom
aisk:xi-memoryerror-swallowed

Conversation

@aisk

@aisk aisk commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

I'm not sure why there was an early return for MemoryError in _PyXI_excinfo_InitFromException(). I guess it was intended to avoid doing too much work when there isn't enough memory. But in a lot of cases, MemoryError is raised when the code tries to create a very large object and malloc() returns NULL. In this case, ignoring the MemoryError is not the expected behavior.

cc @ericsnowcurrently as the original author of the code, who may give some more context. Either way, silently ignoring the exception should be fixed.

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.

1 participant