René's URL Explorer Experiment


Title: Segfault with async generator expressions · Issue #149122 · python/cpython · GitHub

Open Graph Title: Segfault with async generator expressions · Issue #149122 · python/cpython

X Title: Segfault with async generator expressions · Issue #149122 · python/cpython

Description: Crash report What happened? Running: tuple(await 2 for _ in []) on main causes a segfault: backtrace (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0) * frame #0: 0x000000000000000...

Open Graph Description: Crash report What happened? Running: tuple(await 2 for _ in []) on main causes a segfault: backtrace (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, ad...

X Description: Crash report What happened? Running: tuple(await 2 for _ in []) on main causes a segfault: backtrace (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (co...

Opengraph URL: https://github.com/python/cpython/issues/149122

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Segfault with async generator expressions","articleBody":"# Crash report\n\n### What happened?\n\nRunning:\n```python\ntuple(await 2 for _ in [])\n```\non main causes a segfault:\n\u003cdetails>\n\u003csummary>backtrace\u003c/summary>\n\n```\n(lldb) bt\n* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)\n  * frame #0: 0x0000000000000000\n    frame #1: 0x00000001001b1e34 python.exe`_PyForIter_VirtualIteratorNext(tstate=0x00000001004df800, frame=0x0000000100678020, iter=\u003cunavailable>, index_ptr=\u003cunavailable>) at ceval.c:3717:22 [opt]\n    frame #2: 0x00000001001aa02c python.exe`_PyEval_EvalFrameDefault(tstate=\u003cunavailable>, frame=0x0000000100678020, throwflag=\u003cunavailable>) at generated_cases.c.h:6093:36 [opt]\n    frame #3: 0x00000001001a2ff4 python.exe`_PyEval_EvalFrame(tstate=0x00000001004df800, frame=\u003cunavailable>, throwflag=0) at pycore_ceval.h:118:16 [opt] [inlined]\n    frame #4: 0x00000001001a2fe8 python.exe`_PyEval_Vector(tstate=0x00000001004df800, func=0x000000010514b530, locals=0x000000010514e540, args=0x0000000000000000, argcount=0, kwnames=0x0000000000000000) at ceval.c:2124:12 [opt] [inlined]\n    frame #5: 0x00000001001a2fe8 python.exe`PyEval_EvalCode(co=\u003cunavailable>, globals=0x000000010514e540, locals=0x000000010514e540) at ceval.c:686:21 [opt]\n    frame #6: 0x0000000100225080 python.exe`run_eval_code_obj(tstate=\u003cunavailable>, co=\u003cunavailable>, globals=\u003cunavailable>, locals=\u003cunavailable>) at pythonrun.c:1369:12 [opt] [artificial]\n    frame #7: 0x0000000100224ec0 python.exe`run_mod(mod=0x00000008ec416678, filename=0x00000001050f68d0, globals=0x000000010514e540, locals=\u003cunavailable>, flags=\u003cunavailable>, arena=0x000000010503a2f0, interactive_src=\u003cunavailable>, generate_new_source=\u003cunavailable>) at pythonrun.c:1472:19 [opt]\n    frame #8: 0x0000000100222108 python.exe`pyrun_file(fp=0x0000000203f788d0, filename=0x00000001050f68d0, start=257, globals=0x000000010514e540, locals=0x000000010514e540, closeit=1, flags=0x000000016fdfe7f8) at pythonrun.c:1296:15 [opt] [inlined]\n    frame #9: 0x000000010022209c python.exe`_PyRun_SimpleFileObject(fp=0x0000000203f788d0, filename=0x00000001050f68d0, closeit=1, flags=0x000000016fdfe7f8) at pythonrun.c:518:13 [opt]\n    frame #10: 0x0000000100221ad8 python.exe`_PyRun_AnyFileObject(fp=0x0000000203f788d0, filename=0x00000001050f68d0, closeit=1, flags=0x000000016fdfe7f8) at pythonrun.c:81:15 [opt]\n    frame #11: 0x000000010024baf0 python.exe`pymain_run_file_obj(program_name=0x00000001050f69c0, filename=0x00000001050f68d0, skip_source_first_line=0) at main.c:411:15 [opt] [inlined]\n    frame #12: 0x000000010024bab4 python.exe`pymain_run_file(config=0x00000001004aa820) at main.c:430:15 [opt]\n    frame #13: 0x000000010024b34c python.exe`pymain_run_python(exitcode=0x000000016fdfe8d4) at main.c:715:21 [opt] [inlined]\n    frame #14: 0x000000010024af2c python.exe`Py_RunMain at main.c:796:5 [opt]\n    frame #15: 0x000000010024b644 python.exe`pymain_main(args=0x000000016fdfebe0) at main.c:826:12 [opt]\n    frame #16: 0x000000010024b6e4 python.exe`Py_BytesMain(argc=\u003cunavailable>, argv=\u003cunavailable>) at main.c:850:12 [opt]\n    frame #17: 0x00000001978e1d54 dyld`start + 7184\n(lldb)\n```\n\n\u003c/details>\n\nThe regression was introduced by:\nhttps://github.com/python/cpython/issues/131738: optimize builtin any/all/tuple calls with a generator expression arg (https://github.com/python/cpython/pull/131737)\n\nI'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.\n\nReproducible on Macos and linux builds.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n### Output from running 'python -VV' on the command line:\n\nPython 3.14.3 (main, Feb 19 2026, 15:40:46) [Clang 17.0.0 (clang-1700.6.3.2)]\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-149138\n* gh-149151\n* gh-149179\n* gh-149181\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/stestagg","@type":"Person","name":"stestagg"},"datePublished":"2026-04-29T00:33:38Z","url":"https://github.com/python/cpython/issues/149122"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:dbf7c99a-0045-b07f-ccfe-0c85420ec754
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9EC0:7A60E:3C2DEC6:4D2E22C:6B020766
html-safe-nonce5f6df51dd0fb201d8383ca17444adf807053a89d37185bbd8a89fefd328ac1a0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUMwOjdBNjBFOjNDMkRFQzY6NEQyRTIyQzo2QjAyMDc2NiIsInZpc2l0b3JfaWQiOiIxOTEyOTcyODk0OTI1ODgzMjM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8ad139a30f2725bd3c1b27b9f741b1dadd0048360df75d4d846b7c561906342e
hovercard-subject-tagissue:4347110533
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/149122/issue_layout
twitter:imagehttps://opengraph.githubassets.com/45f951038f4bae49c64bdd2cb109f48f1a3bb70500bff79590d21669568fd319/python/cpython/issues/149122
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/45f951038f4bae49c64bdd2cb109f48f1a3bb70500bff79590d21669568fd319/python/cpython/issues/149122
og:image:altCrash report What happened? Running: tuple(await 2 for _ in []) on main causes a segfault: backtrace (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, ad...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamestestagg
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/149122#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F149122
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F149122
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/149122
Reloadhttps://github.com/python/cpython/issues/149122
Reloadhttps://github.com/python/cpython/issues/149122
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/149122
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/149122
#149138https://github.com/python/cpython/pull/149138
Segfault with async generator expressionshttps://github.com/python/cpython/issues/149122#top
#149138https://github.com/python/cpython/pull/149138
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-crashA hard crash of the interpreter, possibly with a core dumphttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-crash%22
https://github.com/stestagg
stestagghttps://github.com/stestagg
on Apr 29, 2026https://github.com/python/cpython/issues/149122#issue-4347110533
#131738https://github.com/python/cpython/issues/131738
#131737https://github.com/python/cpython/pull/131737
gh-149122: Fix segfault in compiler when certain builtin functions are passed a coroutine as arg #149138https://github.com/python/cpython/pull/149138
[3.14] gh-149122: Fix segfault in compiler when certain builtin functions are passed a coroutine as arg (GH-149138) #149151https://github.com/python/cpython/pull/149151
gh-149122: Fix refleak in codegen #149179https://github.com/python/cpython/pull/149179
[3.14] gh-149122: Fix refleak in codegen (GH-149179) #149181https://github.com/python/cpython/pull/149181
stestagghttps://github.com/stestagg
type-crashA hard crash of the interpreter, possibly with a core dumphttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-crash%22
on Apr 29, 2026https://github.com/python/cpython/issues/149122#event-24970625583
https://github.com/stestagg
stestagghttps://github.com/stestagg
on Apr 29, 2026https://github.com/python/cpython/issues/149122#issuecomment-4340070790
@iritkatrielhttps://github.com/iritkatriel
StanFromIrelandhttps://github.com/StanFromIreland
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
on Apr 29, 2026https://github.com/python/cpython/issues/149122#event-24977814408
StanFromIrelandhttps://github.com/StanFromIreland
on Apr 29, 2026https://github.com/python/cpython/issues/149122#event-24978273926
https://github.com/iritkatriel
iritkatrielhttps://github.com/iritkatriel
on Apr 29, 2026https://github.com/python/cpython/issues/149122#issuecomment-4341941582
@stestagghttps://github.com/stestagg
iritkatrielhttps://github.com/iritkatriel
needs backport to 3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22needs%20backport%20to%203.14%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
needs backport to 3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22needs%20backport%20to%203.14%22
on Apr 29, 2026https://github.com/python/cpython/issues/149122#event-24980478277
iritkatrielhttps://github.com/iritkatriel
on Apr 29, 2026https://github.com/python/cpython/issues/149122#event-24991144306
Merge branch 'main' into pythongh-149122https://github.com/iritkatriel/cpython/commit/fd9ec6cbdf613e56e161f884686469f5b8b4c7b8
pythongh-149122https://github.com/python/cpython/issues/149122
fd9ec6chttps://github.com/iritkatriel/cpython/commit/fd9ec6cbdf613e56e161f884686469f5b8b4c7b8
gh-149122: Fix segfault in compiler when certain builtin functions ar…https://github.com/python/cpython/commit/16f292ef4e8c56bfd115ecdb91420c7b4006249f
gh-149122https://github.com/python/cpython/issues/149122
16f292ehttps://github.com/python/cpython/commit/16f292ef4e8c56bfd115ecdb91420c7b4006249f
iritkatrielhttps://github.com/iritkatriel
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#149138https://github.com/python/cpython/pull/149138
on Apr 29, 2026https://github.com/python/cpython/issues/149122#event-24992383038
iritkatrielhttps://github.com/iritkatriel
on Apr 29, 2026https://github.com/python/cpython/issues/149122#event-24993546523
[3.14] gh-149122: Fix segfault in compiler when certain builtin funct…https://github.com/python/cpython/commit/098880de36756c25f9c2588d11c8847c4266c9cf
gh-149122https://github.com/python/cpython/issues/149122
098880dhttps://github.com/python/cpython/commit/098880de36756c25f9c2588d11c8847c4266c9cf
https://github.com/encukou
encukouhttps://github.com/encukou
on Apr 30, 2026https://github.com/python/cpython/issues/149122#issuecomment-4351328981
encukouhttps://github.com/encukou
on Apr 30, 2026https://github.com/python/cpython/issues/149122#event-25027653422
encukouhttps://github.com/encukou
on Apr 30, 2026https://github.com/python/cpython/issues/149122#event-25028728291
gh-149122: Fix refleak in codegen (GH-149179)https://github.com/python/cpython/commit/4599335a83a22cf73a0c20e3692c29fd0278d23b
gh-149122https://github.com/python/cpython/issues/149122
GH-149179https://github.com/python/cpython/pull/149179
4599335https://github.com/python/cpython/commit/4599335a83a22cf73a0c20e3692c29fd0278d23b
kumaraditya303https://github.com/kumaraditya303
on Apr 30, 2026https://github.com/python/cpython/issues/149122#event-25035165763
[3.14] gh-149122: Fix refleak in codegen (GH-149179) (#149181)https://github.com/python/cpython/commit/bfcaeead9fc9d19c499a671b0071ce5aa8c91e83
gh-149122https://github.com/python/cpython/issues/149122
GH-149179https://github.com/python/cpython/pull/149179
#149181https://github.com/python/cpython/pull/149181
bfcaeeahttps://github.com/python/cpython/commit/bfcaeead9fc9d19c499a671b0071ce5aa8c91e83
kumaraditya303https://github.com/kumaraditya303
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Apr 30, 2026https://github.com/python/cpython/issues/149122#event-25035175200
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/149122
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/149122
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-crashA hard crash of the interpreter, possibly with a core dumphttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-crash%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.