René's URL Explorer Experiment


Title: Many places have missing `PyErr_NoMemory()` call after failing memory allocation · Issue #151126 · python/cpython · GitHub

Open Graph Title: Many places have missing `PyErr_NoMemory()` call after failing memory allocation · Issue #151126 · python/cpython

X Title: Many places have missing `PyErr_NoMemory()` call after failing memory allocation · Issue #151126 · python/cpython

Description: Crash report remove_unused_consts in Python/flowgraph.c When PyMem_Malloc(nconsts * sizeof(Py_ssize_t)); fails, we need to set an exception. cpython/Python/flowgraph.c Lines 3267 to 3283 in 29a920e static int remove_unused_consts(basicbl...

Open Graph Description: Crash report remove_unused_consts in Python/flowgraph.c When PyMem_Malloc(nconsts * sizeof(Py_ssize_t)); fails, we need to set an exception. cpython/Python/flowgraph.c Lines 3267 to 3283 in 29a920e...

X Description: Crash report remove_unused_consts in Python/flowgraph.c When PyMem_Malloc(nconsts * sizeof(Py_ssize_t)); fails, we need to set an exception. cpython/Python/flowgraph.c Lines 3267 to 3283 in 29a920e...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Many places have missing `PyErr_NoMemory()` call after failing memory allocation","articleBody":"# Crash report\n\n1. `remove_unused_consts` in `Python/flowgraph.c`\n\nWhen `PyMem_Malloc(nconsts * sizeof(Py_ssize_t));` fails, we need to set an exception.\n\nhttps://github.com/python/cpython/blob/29a920e80e21490b5bdb7178373f80fe606a4403/Python/flowgraph.c#L3267-L3283\n\n2. `gethandlelist` and `getattributelist` in `_winapi.c`\n\nThis place misses it:\n\nhttps://github.com/python/cpython/blob/9fdbade99e6bcc607d9f12416bfca5bbf94022b9/Modules/_winapi.c#L1196-L1198\n\nAll other error paths set exceptions, except this `if`:\n\nhttps://github.com/python/cpython/blob/9fdbade99e6bcc607d9f12416bfca5bbf94022b9/Modules/_winapi.c#L1278-L1282\n\n3. `_channelends_new` in `Modules/_interpchannelsmodule.c`\n\nhttps://github.com/python/cpython/blob/3ca93ab198497da9451101019b67c52e7873377d/Modules/_interpchannelsmodule.c#L920-L926\n\nLater we check for errors in `handle_channel_error`, it requires either setting `err` to non `-1` or to set Python exception. Both are false, it fails with the assertion failure.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-151127\n* gh-151134\n* gh-151135\n* gh-151136\n* gh-151137\n* gh-151154\n* gh-151180\n* gh-151181\n* gh-151182\n* gh-151239\n* gh-151265\n* gh-151266\n* gh-151336\n* gh-151338\n* gh-151339\n* gh-151360\n* gh-151361\n* gh-151362\n* gh-151382\n* gh-151398\n* gh-151399\n* gh-151400\n* gh-151580\n* gh-151582\n* gh-151588\n* gh-151590\n* gh-151624\n* gh-151639\n* gh-152014\n* gh-152015\n* gh-152016\n* gh-152169\n* gh-152170\n* gh-152177\n* gh-152179\n* gh-152180\n* gh-152181\n* gh-152182\n* gh-152183\n* gh-152184\n* gh-152418\n* gh-152420\n* gh-152421\n* gh-152422\n* gh-152478\n* gh-152677\n* gh-152678\n* gh-152720\n* gh-153215\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2026-06-09T06:32:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/151126/cpython/issues/151126"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d591370b-65ce-9f61-03f4-a0cae8f7260e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8C00:1D1D40:187398:210EE8:6A517369
html-safe-noncecd938367d9412b2ded6b0f8d8013f7ce78ea43f6eaeffbfc87fc9c0a91004d2b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzAwOjFEMUQ0MDoxODczOTg6MjEwRUU4OjZBNTE3MzY5IiwidmlzaXRvcl9pZCI6IjcyNzI3MjYzNDIzODIyMjAxMzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd200b02a41c1f5b8434c3df2e7a5fb3fd80b4966926b30824e29a93c61a0ee03
hovercard-subject-tagissue:4619485083
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/151126/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5b1b9a85d74c08326c53d5f47cdeb46358485cc10d56d5de49be62c931e76cf3/python/cpython/issues/151126
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5b1b9a85d74c08326c53d5f47cdeb46358485cc10d56d5de49be62c931e76cf3/python/cpython/issues/151126
og:image:altCrash report remove_unused_consts in Python/flowgraph.c When PyMem_Malloc(nconsts * sizeof(Py_ssize_t)); fails, we need to set an exception. cpython/Python/flowgraph.c Lines 3267 to 3283 in 29a920e...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesobolevn
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
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
releaseb19955a9dd40fd99462443f7911b522d7216776a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/151126#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F151126
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F151126
Sign up https://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/151126
Reloadhttps://github.com/python/cpython/issues/151126
Reloadhttps://github.com/python/cpython/issues/151126
Please reload this pagehttps://github.com/python/cpython/issues/151126
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/151126
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.7k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Many places have missing PyErr_NoMemory() call after failing memory allocationhttps://github.com/python/cpython/issues/151126#top
https://github.com/sobolevn
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/sobolevn
sobolevnhttps://github.com/sobolevn
on Jun 9, 2026https://github.com/python/cpython/issues/151126#issue-4619485083
cpython/Python/flowgraph.chttps://github.com/python/cpython/blob/29a920e80e21490b5bdb7178373f80fe606a4403/Python/flowgraph.c#L3267-L3283
29a920ehttps://github.com/python/cpython/commit/29a920e80e21490b5bdb7178373f80fe606a4403
cpython/Modules/_winapi.chttps://github.com/python/cpython/blob/9fdbade99e6bcc607d9f12416bfca5bbf94022b9/Modules/_winapi.c#L1196-L1198
9fdbadehttps://github.com/python/cpython/commit/9fdbade99e6bcc607d9f12416bfca5bbf94022b9
cpython/Modules/_winapi.chttps://github.com/python/cpython/blob/9fdbade99e6bcc607d9f12416bfca5bbf94022b9/Modules/_winapi.c#L1278-L1282
9fdbadehttps://github.com/python/cpython/commit/9fdbade99e6bcc607d9f12416bfca5bbf94022b9
cpython/Modules/_interpchannelsmodule.chttps://github.com/python/cpython/blob/3ca93ab198497da9451101019b67c52e7873377d/Modules/_interpchannelsmodule.c#L920-L926
3ca93abhttps://github.com/python/cpython/commit/3ca93ab198497da9451101019b67c52e7873377d
gh-151126: Fix missing PyErr_NoMemory() in remove_unused_consts #151127https://github.com/python/cpython/pull/151127
[3.15] gh-151126: Fix missing PyErr_NoMemory() in remove_unused_consts (GH-151127) #151134https://github.com/python/cpython/pull/151134
[3.14] gh-151126: Fix missing PyErr_NoMemory() in remove_unused_consts (GH-151127) #151135https://github.com/python/cpython/pull/151135
[3.13] gh-151126: Fix missing PyErr_NoMemory() in remove_unused_consts (GH-151127) #151136https://github.com/python/cpython/pull/151136
gh-151126: Add PyErr_NoMemory() in strong_cache_node_new #151137https://github.com/python/cpython/pull/151137
gh-151126: Add missing PyErr_NoMemory in _winapi module #151154https://github.com/python/cpython/pull/151154
[3.15] gh-151126: Add missing PyErr_NoMemory in _winapi module (GH-151154) #151180https://github.com/python/cpython/pull/151180
[3.14] gh-151126: Add missing PyErr_NoMemory in _winapi module (GH-151154) #151181https://github.com/python/cpython/pull/151181
[3.13] gh-151126: Add missing PyErr_NoMemory in _winapi module (GH-151154) #151182https://github.com/python/cpython/pull/151182
gh-151126: Fix missing memory errors in _interpchannelsmodule.c #151239https://github.com/python/cpython/pull/151239
[3.15] gh-151126: Fix missing memory errors in _interpchannelsmodule.c (GH-151239) #151265https://github.com/python/cpython/pull/151265
[3.13] gh-151126: Fix missing memory errors in _interpchannelsmodule.c (GH-151239) #151266https://github.com/python/cpython/pull/151266
[3.14] gh-151126: Fix missing memory errors in _interpchannelsmodule.c (GH-151239) #151336https://github.com/python/cpython/pull/151336
[3.13] gh-151126: Fix missing memory errors in _interpchannelsmodule.c (GH-151239) #151338https://github.com/python/cpython/pull/151338
gh-151126: Fix missing memory error in os._path_splitroot #151339https://github.com/python/cpython/pull/151339
[3.15] gh-151126: Fix missing memory error in os._path_splitroot (GH-151339) #151360https://github.com/python/cpython/pull/151360
[3.14] gh-151126: Fix missing memory error in os._path_splitroot (GH-151339) #151361https://github.com/python/cpython/pull/151361
[3.13] gh-151126: Fix missing memory error in os._path_splitroot (GH-151339) #151362https://github.com/python/cpython/pull/151362
gh-151126: Fix crash on unset memory error in ctypes.get_errno #151382https://github.com/python/cpython/pull/151382
[3.15] gh-151126: Fix crash on unset memory error in ctypes.get_errno (GH-151382) #151398https://github.com/python/cpython/pull/151398
[3.14] gh-151126: Fix crash on unset memory error in ctypes.get_errno (GH-151382) #151399https://github.com/python/cpython/pull/151399
[3.13] gh-151126: Fix crash on unset memory error in ctypes.get_errno (GH-151382) #151400https://github.com/python/cpython/pull/151400
gh-151126: Fix missing PyErr_NoMemory in fileutils.c #151580https://github.com/python/cpython/pull/151580
gh-151126: Fix missing PyErr_NoMemory in typeobject.c #151582https://github.com/python/cpython/pull/151582
gh-151126: Add missing PyErr_NoMemory in _winapi.c #151588https://github.com/python/cpython/pull/151588
gh-151126: Fix missing PyErr_NoMemory in getpath.c #151590https://github.com/python/cpython/pull/151590
gh-151126:Fix missing memory errors in _interpretersmodule.c #151624https://github.com/python/cpython/pull/151624
gh-151126: Fix missing memory errors in _interpqueuesmodule.c #151639https://github.com/python/cpython/pull/151639
[3.13] gh-151126: Add missing PyErr_NoMemory() in type_from_slots_or_spec (GH-151582) #152014https://github.com/python/cpython/pull/152014
[3.14] gh-151126: Add missing PyErr_NoMemory() in type_from_slots_or_spec (GH-151582) #152015https://github.com/python/cpython/pull/152015
[3.15] gh-151126: Add missing PyErr_NoMemory() in type_from_slots_or_spec (GH-151582) #152016https://github.com/python/cpython/pull/152016
[3.15] gh-151126: Fix missing memory errors in _interpretersmodule.c (GH-151624) #152169https://github.com/python/cpython/pull/152169
[3.14] gh-151126: Fix missing memory errors in _interpretersmodule.c (GH-151624) #152170https://github.com/python/cpython/pull/152170
gh-151126: Fix missing PyErr_NoMemory in testinternalcapi.c #152177https://github.com/python/cpython/pull/152177
[3.15] gh-151126: Fix missing PyErr_NoMemory in testinternalcapi.c (GH-152177) #152179https://github.com/python/cpython/pull/152179
[3.14] gh-151126: Fix missing PyErr_NoMemory in testinternalcapi.c (GH-152177) #152180https://github.com/python/cpython/pull/152180
[3.13] gh-151126: Fix missing PyErr_NoMemory in testinternalcapi.c (GH-152177) #152181https://github.com/python/cpython/pull/152181
[3.15] gh-151126: Add missing PyErr_NoMemory in _winapi.c (GH-151588) #152182https://github.com/python/cpython/pull/152182
[3.14] gh-151126: Add missing PyErr_NoMemory in _winapi.c (GH-151588) #152183https://github.com/python/cpython/pull/152183
[3.13] gh-151126: Add missing PyErr_NoMemory in _winapi.c (GH-151588) #152184https://github.com/python/cpython/pull/152184
gh-151126: Sets missing exceptions in tkinter and socket modules initializations #152418https://github.com/python/cpython/pull/152418
[3.15] gh-151126: Sets missing exceptions in tkinter and socket modules initializations (GH-152418) #152420https://github.com/python/cpython/pull/152420
[3.14] gh-151126: Sets missing exceptions in tkinter and socket modules initializations (GH-152418) #152421https://github.com/python/cpython/pull/152421
[3.13] gh-151126: Sets missing exceptions in tkinter and socket modules initializations (GH-152418) #152422https://github.com/python/cpython/pull/152422
gh-151126: Fix a possible crash during the startup with no memory under Py_STACKREF_DEBUG #152478https://github.com/python/cpython/pull/152478
[3.15] gh-151126: Fix a possible crash during the startup with no memory under Py_STACKREF_DEBUG (GH-152478) #152677https://github.com/python/cpython/pull/152677
[3.14] gh-151126: Fix a possible crash during the startup with no memory under Py_STACKREF_DEBUG (GH-152478) #152678https://github.com/python/cpython/pull/152678
gh-151126: Fix PyErr_NoMemory errors in _ctypes.c  #152720https://github.com/python/cpython/pull/152720
gh-151126: Set MemoryError in test C API allocation failures #153215https://github.com/python/cpython/pull/153215
sobolevnhttps://github.com/sobolevn
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
Date and time issues 🕰️https://github.com/orgs/python/projects/21
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.