René's URL Explorer Experiment


Title: Segfault: NULL info deref in _excinfo_clear_type via _PyXI_FreeExcInfo(NULL) (Python/crossinterp.c:1319) · Issue #151842 · python/cpython · GitHub

Open Graph Title: Segfault: NULL info deref in _excinfo_clear_type via _PyXI_FreeExcInfo(NULL) (Python/crossinterp.c:1319) · Issue #151842 · python/cpython

X Title: Segfault: NULL info deref in _excinfo_clear_type via _PyXI_FreeExcInfo(NULL) (Python/crossinterp.c:1319) · Issue #151842 · python/cpython

Description: Crash report Segfault: NULL info deref in _excinfo_clear_type via _PyXI_FreeExcInfo(NULL) _interpreters.capture_exception() builds a _PyXI_excinfo via _PyXI_NewExcInfo(). Under memory pressure that allocation can fail and return NULL. Th...

Open Graph Description: Crash report Segfault: NULL info deref in _excinfo_clear_type via _PyXI_FreeExcInfo(NULL) _interpreters.capture_exception() builds a _PyXI_excinfo via _PyXI_NewExcInfo(). Under memory pressure that...

X Description: Crash report Segfault: NULL info deref in _excinfo_clear_type via _PyXI_FreeExcInfo(NULL) _interpreters.capture_exception() builds a _PyXI_excinfo via _PyXI_NewExcInfo(). Under memory pressure that...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Segfault: NULL info deref in _excinfo_clear_type via _PyXI_FreeExcInfo(NULL) (Python/crossinterp.c:1319)","articleBody":"# Crash report\n\n## Segfault: NULL `info` deref in `_excinfo_clear_type` via `_PyXI_FreeExcInfo(NULL)`\n\n`_interpreters.capture_exception()` builds a `_PyXI_excinfo` via `_PyXI_NewExcInfo()`. Under memory pressure that allocation can fail and return `NULL`. The cleanup path in `_interpreters_capture_exception_impl` then unconditionally calls `_PyXI_FreeExcInfo(info)` with `info == NULL`. `_PyXI_FreeExcInfo` has no NULL guard, so `_PyXI_excinfo_clear` → `_excinfo_clear_type` dereferences `\u0026NULL-\u003etype` (offset 0) at `Python/crossinterp.c:1319` → SIGSEGV.\n\nThis reproduces on all build configurations (a NULL dereference, not a debug-only assert).\n\n### Reproducer\n\n```python\nimport faulthandler, _interpreters\nfaulthandler.enable()\nfrom _testcapi import set_nomemory, remove_mem_hooks\nfor start in range(0, 40):\n    try:\n        set_nomemory(start, 0)\n        try:\n            _interpreters.capture_exception(Exception())\n        finally:\n            remove_mem_hooks()\n    except BaseException:\n        pass\n    finally:\n        try: remove_mem_hooks()\n        except Exception: pass\n```\n\n### Backtrace\n\n```\n#0  _excinfo_clear_type                  Python/crossinterp.c:1319   # info == 0x0 -\u003e offset-0 deref\n#1  _PyXI_excinfo_clear                  Python/crossinterp.c:1374\n#2  _PyXI_FreeExcInfo                    Python/crossinterp.c:1712   # called with info == NULL, no guard\n#3  _interpreters_capture_exception_impl Modules/_interpretersmodule.c:1544\n#4  cfunction_vectorcall_FASTCALL_KEYWORDS Objects/methodobject.c:465\n```\n\n### Root cause\n\n`Modules/_interpretersmodule.c`, `_interpreters_capture_exception_impl` (≈L1522-1544):\n\n```c\n_PyXI_excinfo *info = _PyXI_NewExcInfo(exc);   /* returns NULL under OOM */\nif (info == NULL) {\n    goto finally;\n}\n/* ... */\nfinally:\n    _PyXI_FreeExcInfo(info);                   /* L1544: runs even when info == NULL */\n```\n\n`_PyXI_NewExcInfo` (`crossinterp.c:1683`) does `PyMem_RawCalloc` for its struct and, on any failure, `PyMem_RawFree`s it and returns `NULL` — so `info` here is a clean `NULL`, not a dangling half-built struct.\n\n`_PyXI_FreeExcInfo` (`crossinterp.c:1710`) has no NULL guard:\n\n```c\nvoid\n_PyXI_FreeExcInfo(_PyXI_excinfo *info)\n{\n    _PyXI_excinfo_clear(info);   /* dereferences info */\n    PyMem_RawFree(info);\n}\n```\n\n### Suggested fix\n\nMake `_PyXI_FreeExcInfo` NULL-safe, matching the surrounding `PyMem_RawFree(NULL)` idiom (and `Py_XDECREF`, `free()`, etc.):\n\n```c\nvoid\n_PyXI_FreeExcInfo(_PyXI_excinfo *info)\n{\n    if (info == NULL) {\n        return;\n    }\n    _PyXI_excinfo_clear(info);\n    PyMem_RawFree(info);\n}\n```\n\nThis is more defensive than guarding only the one call site, since the function is part of the cross-interpreter exception ABI and any future caller would otherwise have the same hazard.\n\n### Notes\n\nPart of #151763 (umbrella tracking 35 OOM-related crash findings); OOM-0031 in that table.\n\n### CPython versions tested on:\n\nCPython main branch (3.16.0a0)\n\n### Operating systems tested on:\n\nLinux, Windows\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-151843\n* gh-152031\n* gh-152032\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/amruthamodela06","@type":"Person","name":"amruthamodela06"},"datePublished":"2026-06-21T12:44:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/151842/cpython/issues/151842"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b779830f-ea76-9ee5-49c5-228a1b69eaf2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEB7A:20E8B8:F6E262:152FA14:6A53B7FD
html-safe-nonce4310b2a0fd23aace476190e7a24cfb41223bf08e0b1ab6aa9a73611cd9f17d37
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjdBOjIwRThCODpGNkUyNjI6MTUyRkExNDo2QTUzQjdGRCIsInZpc2l0b3JfaWQiOiI3OTczMjAxOTM0NjAwNjE1OTMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace4904156729df8a3f9141ef375a138ecf3c74beee7d12e94c81166af171ad967
hovercard-subject-tagissue:4710515779
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/151842/issue_layout
twitter:imagehttps://opengraph.githubassets.com/42d3e802c716e29469f44523a430d57be81a072d5a27231a314ae8ba1e10dffa/python/cpython/issues/151842
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/42d3e802c716e29469f44523a430d57be81a072d5a27231a314ae8ba1e10dffa/python/cpython/issues/151842
og:image:altCrash report Segfault: NULL info deref in _excinfo_clear_type via _PyXI_FreeExcInfo(NULL) _interpreters.capture_exception() builds a _PyXI_excinfo via _PyXI_NewExcInfo(). Under memory pressure that...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameamruthamodela06
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
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/151842#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F151842
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%2F151842
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/151842
Reloadhttps://github.com/python/cpython/issues/151842
Reloadhttps://github.com/python/cpython/issues/151842
Please reload this pagehttps://github.com/python/cpython/issues/151842
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/151842
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k 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
#151843https://github.com/python/cpython/pull/151843
Segfault: NULL info deref in _excinfo_clear_type via _PyXI_FreeExcInfo(NULL) (Python/crossinterp.c:1319)https://github.com/python/cpython/issues/151842#top
#151843https://github.com/python/cpython/pull/151843
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/amruthamodela06
amruthamodela06https://github.com/amruthamodela06
on Jun 21, 2026https://github.com/python/cpython/issues/151842#issue-4710515779
#151763https://github.com/python/cpython/issues/151763
gh-151842: Make _PyXI_FreeExcInfo NULL-safe to fix crash on capture_exception() OOM (OOM-0031) #151843https://github.com/python/cpython/pull/151843
[3.15] gh-151842: Fix crash upon OOM in _interpreters.capture_exception (GH-151843) #152031https://github.com/python/cpython/pull/152031
[3.14] gh-151842: Fix crash upon OOM in _interpreters.capture_exception (GH-151843) #152032https://github.com/python/cpython/pull/152032
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
Subinterpretershttps://github.com/orgs/python/projects/3
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.