Title: bltinmodule.c: lazy_import NULL deref without Python frame · Issue #151510 · python/cpython · GitHub
Open Graph Title: bltinmodule.c: lazy_import NULL deref without Python frame · Issue #151510 · python/cpython
X Title: bltinmodule.c: lazy_import NULL deref without Python frame · Issue #151510 · python/cpython
Description: Crash report What happened? Original gist: https://gist.github.com/devdanzin/cc84f43d7a5c774b47551060c061391f. A PR is on the way. Summary builtin___lazy_import___impl (line 321): When globals=NULL and PyEval_GetGlobals() returns NULL (n...
Open Graph Description: Crash report What happened? Original gist: https://gist.github.com/devdanzin/cc84f43d7a5c774b47551060c061391f. A PR is on the way. Summary builtin___lazy_import___impl (line 321): When globals=NULL...
X Description: Crash report What happened? Original gist: https://gist.github.com/devdanzin/cc84f43d7a5c774b47551060c061391f. A PR is on the way. Summary builtin___lazy_import___impl (line 321): When globals=NULL...
Opengraph URL: https://github.com/python/cpython/issues/151510
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bltinmodule.c: lazy_import NULL deref without Python frame","articleBody":"# Crash report\n\n### What happened?\n\nOriginal gist: https://gist.github.com/devdanzin/cc84f43d7a5c774b47551060c061391f. A PR is on the way.\n\n## Summary\n\n`builtin___lazy_import___impl` (line 321): When `globals=NULL` and `PyEval_GetGlobals()` returns NULL (no Python frame), `PyDict_Check(globals)` dereferences NULL → segfault. Reachable from embedded interpreters.\n\n## Fix\n\nAdd NULL check for `globals` after `PyEval_GetGlobals()`.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n### Output from running 'python -VV' on the command line:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-151511\n* gh-151610\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/aisk","@type":"Person","name":"aisk"},"datePublished":"2026-06-15T15:45:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/151510/cpython/issues/151510"}
| 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:378ae33f-7ecd-916c-0035-2fcdffb54c7c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9914:175ED6:2BD8C9B:3E9C51D:6A51117F |
| html-safe-nonce | fd8040f81c984c06013027b7a2740eec57681dc0eed406a8ecb081ce4f97d412 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTE0OjE3NUVENjoyQkQ4QzlCOjNFOUM1MUQ6NkE1MTExN0YiLCJ2aXNpdG9yX2lkIjoiNjQ3MDQyODk2NDA0NTI2MzIzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 431b52d2654bde79b49d31fb02f7a375e4570c644a1b3c1ae159b4fed8d23806 |
| hovercard-subject-tag | issue:4666619895 |
| 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/151510/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c12199a83511d24dcdd9031e9e411a11cbcf89123de6bd850fddfbaf2706243d/python/cpython/issues/151510 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c12199a83511d24dcdd9031e9e411a11cbcf89123de6bd850fddfbaf2706243d/python/cpython/issues/151510 |
| og:image:alt | Crash report What happened? Original gist: https://gist.github.com/devdanzin/cc84f43d7a5c774b47551060c061391f. A PR is on the way. Summary builtin___lazy_import___impl (line 321): When globals=NULL... |
| 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