Repository navigation
Segfault with async generator expressions #149122
Copy link
Copy link
Closed
Labels
3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
Activity
- addedtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
on Apr 29, 2026 Tagging the commit author: @iritkatriel
- addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
on Apr 29, 2026 - changed the title
[-]Segfault with invalid await and inline-for in tuple()/any/all call gh-131738[/-][+]Segfault with async generator expressions[/+]on Apr 29, 2026 Thank you @stestagg. I've submitted a fix.
Reacted by Steve Stagg- addedneeds backport to 3.14bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesand removedneeds backport to 3.14bugs and security fixesbugs and security fixes
on Apr 29, 2026 - added a commit that references this issue
on Apr 29, 2026 This introduced a refleak.
Reacted by Irit Katriel- added a commit that references this issue
on Apr 30, 2026
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Crash report
What happened?
Running:
on main causes a segfault:
backtrace
The regression was introduced by:
#131738: optimize builtin any/all/tuple calls with a generator expression arg (#131737)
I'm guessing the missing syntax check means we have an async iter inside the call, and the optimized path is assunming it's a sync iter? I'm not an expert here.
Reproducible on Macos and linux builds.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.14.3 (main, Feb 19 2026, 15:40:46) [Clang 17.0.0 (clang-1700.6.3.2)]
Linked PRs