Title: ceval.c: missing PyErr_NoMemory + PyEval_GetLocals NULL · Issue #153205 · python/cpython · GitHub
Open Graph Title: ceval.c: missing PyErr_NoMemory + PyEval_GetLocals NULL · Issue #153205 · python/cpython
X Title: ceval.c: missing PyErr_NoMemory + PyEval_GetLocals NULL · Issue #153205 · python/cpython
Description: Bug report Bug description: Original gist: https://gist.githubusercontent.com/devdanzin/55ed5cf0d452eb6ce881e7a8fad30ddb/raw/aec57efe5d45a6995757b60970173d5dca92f188/ceval_stackref_oom.md ceval.c: Missing PyErr_NoMemory in _PyObjectArray...
Open Graph Description: Bug report Bug description: Original gist: https://gist.githubusercontent.com/devdanzin/55ed5cf0d452eb6ce881e7a8fad30ddb/raw/aec57efe5d45a6995757b60970173d5dca92f188/ceval_stackref_oom.md ceval.c: ...
X Description: Bug report Bug description: Original gist: https://gist.githubusercontent.com/devdanzin/55ed5cf0d452eb6ce881e7a8fad30ddb/raw/aec57efe5d45a6995757b60970173d5dca92f188/ceval_stackref_oom.md ceval.c: ...
Opengraph URL: https://github.com/python/cpython/issues/153205
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ceval.c: missing PyErr_NoMemory + PyEval_GetLocals NULL","articleBody":"# Bug report\n\n### Bug description:\n\nOriginal gist: https://gist.githubusercontent.com/devdanzin/55ed5cf0d452eb6ce881e7a8fad30ddb/raw/aec57efe5d45a6995757b60970173d5dca92f188/ceval_stackref_oom.md\n\n\u003e \n\u003e # ceval.c: Missing PyErr_NoMemory in _PyObjectArray_FromStackRefArray + PyEval_GetLocals NULL deref\n\u003e \n\u003e ## Summary\n\u003e \n\u003e 1. `_PyObjectArray_FromStackRefArray` (line 1112): `PyMem_Malloc` returns NULL without exception. Affects ~10 vectorcall functions → SystemError.\n\u003e 2. `PyEval_GetLocals` (line 2622): `_PyFrame_GetFrameObject` can return NULL, immediately dereferenced → segfault.\n\u003e \n\u003e ## Fix\n\u003e \n\u003e 1. Add `PyErr_NoMemory()` after `PyMem_Malloc` failure.\n\u003e 2. Add NULL check after `_PyFrame_GetFrameObject`.\n\nBut the second `_PyFrame_GetFrameObject` issue is already resolved by https://github.com/python/cpython/pull/146124\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-153206\n* gh-153272\n* gh-153273\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/aisk","@type":"Person","name":"aisk"},"datePublished":"2026-07-06T14:48:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/153205/cpython/issues/153205"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c57f0725-f2ca-dd76-ac41-fc1438801a6a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA06:ADE9F:DBCB1:131F24:6A51110B |
| html-safe-nonce | dfb8845a83afde85b17a1e078af176f331978ddc5fa728bd41bb49ce3368e3da |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTA2OkFERTlGOkRCQ0IxOjEzMUYyNDo2QTUxMTEwQiIsInZpc2l0b3JfaWQiOiI0Mjc1MzgwMTU5NTU5ODMxODE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b2eea16e50ff3fec9ae630e6b580f7495283af35f56aee1813fb28917ca1ece0 |
| hovercard-subject-tag | issue:4820261942 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/153205/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6511711f2a81d3e8f651b93648fc4b85da8642b0332000b3d2941c9750b58d5a/python/cpython/issues/153205 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6511711f2a81d3e8f651b93648fc4b85da8642b0332000b3d2941c9750b58d5a/python/cpython/issues/153205 |
| og:image:alt | Bug report Bug description: Original gist: https://gist.githubusercontent.com/devdanzin/55ed5cf0d452eb6ce881e7a8fad30ddb/raw/aec57efe5d45a6995757b60970173d5dca92f188/ceval_stackref_oom.md ceval.c: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aisk |
| hostname | github.com |
| expected-hostname | github.com |
| None | b076e100febaa00374cd89239f915d00dd3187f7c68b12bc2b7688181305344d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f9137f6d981cbbfd780af369f80ce890b2d0d2d4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width