Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
Avoid memory leak in _pop_preserved() #147998
Copy link
Copy link
Closed
Labels
3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
Bug description:
Inspired by gh-147960, I asked Claude Code (full disclosure), using @devdanzin's https://github.com/devdanzin/code-review-toolkit, to find more similar blunders. I think that this kind of mechanical omissions are ideal matches for LLM.
While I could not find exact missing
PyMem_RawFree()and I do not agree with other (tortured) findings, there was a real one:cpython/Python/crossinterp.c
Line 2968 in 7817651
cpython/Python/crossinterp.c
Line 2991 in 7817651
The
xidataseems to be shadowed inside theelse, and theerror:path does not see it.Reproduction
on
CC=clang CXX=clang++ ./configure --with-pydebug --with-address-sanitizer --without-pymalloc -without-mimallocbuild.Another (Claude Code's) reproduction:
https://gist.github.com/maurycy/17e5aae1c8c665118c7980f373494e6e
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs