René's URL Explorer Experiment


Title: Missing `PyErr_NoMemory` in `_zoneinfo` `load_data` and `ts_to_local` · Issue #146092 · python/cpython · GitHub

Open Graph Title: Missing `PyErr_NoMemory` in `_zoneinfo` `load_data` and `ts_to_local` · Issue #146092 · python/cpython

X Title: Missing `PyErr_NoMemory` in `_zoneinfo` `load_data` and `ts_to_local` · Issue #146092 · python/cpython

Description: Crash report What happened? It's possible to cause assertion errors due to calls returning NULL on OOM in _zoneinfo. Automated diagnosis: Multiple PyMem_Malloc/PyMem_Calloc calls in load_data (including ts_to_local at line 2130) return N...

Open Graph Description: Crash report What happened? It's possible to cause assertion errors due to calls returning NULL on OOM in _zoneinfo. Automated diagnosis: Multiple PyMem_Malloc/PyMem_Calloc calls in load_data (incl...

X Description: Crash report What happened? It's possible to cause assertion errors due to calls returning NULL on OOM in _zoneinfo. Automated diagnosis: Multiple PyMem_Malloc/PyMem_Calloc calls in load_data (...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Missing `PyErr_NoMemory` in `_zoneinfo` `load_data` and `ts_to_local`","articleBody":"# Crash report\n\n### What happened?\n\nIt's possible to cause assertion errors due to calls returning `NULL` on OOM in `_zoneinfo`.\n\n### Automated diagnosis:\n\nMultiple `PyMem_Malloc`/`PyMem_Calloc` calls in `load_data` (including `ts_to_local` at line 2130) return `NULL` on OOM and goto `error` without setting an exception. The caller returns `NULL` without exception → assertion failure.\n\nFile: `Modules/_zoneinfo.c`, lines 1029-1137 (`load_data`), 2130 (`ts_to_local`)\n\nMRE for `load_data`:\n```python\nimport _testcapi, sys\n\nfor mod in [\"zoneinfo\", \"_zoneinfo\"]:\n    if mod in sys.modules:\n        del sys.modules[mod]\n\nfor n in range(1, 50):\n    for mod in [\"zoneinfo\", \"_zoneinfo\"]:\n        if mod in sys.modules:\n            del sys.modules[mod]\n    print(n)\n    _testcapi.set_nomemory(n, 0)\n    try:\n        from zoneinfo import ZoneInfo\n        z = ZoneInfo(\"UTC\")\n        _testcapi.remove_mem_hooks()\n        break\n    except MemoryError:\n        _testcapi.remove_mem_hooks()\n```\n\nMRE for `ts_to_local`:\n```python\nimport _testcapi\nfrom zoneinfo import ZoneInfo\n\n# Warm up imports — we only want OOM during zone construction\n_ = ZoneInfo(\"UTC\")\ndel _\n\n# Clear cache so America/New_York gets re-loaded from TZif data\nZoneInfo.clear_cache()\n\n# Persistent failure from allocation #9 onward.\n# Early allocs (import machinery, arg parsing) succeed;\n# the PyMem_Malloc in load_data/ts_to_local fails.\n_testcapi.set_nomemory(9, 0)\n\nz = ZoneInfo(\"America/New_York\")  # crashes: assertion `obj != NULL'\n```\n\nBacktrace:\n```\npython: ./Include/internal/pycore_stackref.h:554: _PyStackRef PyStackRef_FromPyObjectSteal(PyObject *): Assertion `obj != NULL' failed.\n\nProgram received signal SIGABRT, Aborted.\n\n#0  __pthread_kill_implementation (threadid=\u003coptimized out\u003e, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44\n#1  __pthread_kill_internal (threadid=\u003coptimized out\u003e, signo=6) at ./nptl/pthread_kill.c:89\n#2  __GI___pthread_kill (threadid=\u003coptimized out\u003e, signo=signo@entry=6) at ./nptl/pthread_kill.c:100\n#3  0x00007ffff7c45e2e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26\n#4  0x00007ffff7c28888 in __GI_abort () at ./stdlib/abort.c:77\n#5  0x00007ffff7c287f0 in __assert_fail_base (fmt=\u003coptimized out\u003e, assertion=\u003coptimized out\u003e, file=\u003coptimized out\u003e, line=\u003coptimized out\u003e, function=\u003coptimized out\u003e) at ./assert/assert.c:118\n#6  0x00007ffff7c3c19f in __assert_fail (assertion=\u003coptimized out\u003e, file=\u003coptimized out\u003e, line=\u003coptimized out\u003e, function=\u003coptimized out\u003e) at ./assert/assert.c:127\n#7  0x000055555587fd55 in PyStackRef_FromPyObjectSteal (obj=\u003coptimized out\u003e) at ./Include/internal/pycore_stackref.h:554\n#8  0x0000555555842cd0 in _PyEval_EvalFrameDefault (tstate=tstate@entry=0x555555d99c08 \u003c_PyRuntime+360664\u003e, frame=\u003coptimized out\u003e, frame@entry=0x7ffff7fa70a0, throwflag=throwflag@entry=0)\n    at Python/generated_cases.c.h:292\n#9  0x000055555583f08b in _PyEval_EvalFrame (tstate=0x555555d99c08 \u003c_PyRuntime+360664\u003e, frame=0x7ffff7fa70a0, throwflag=0) at ./Include/internal/pycore_ceval.h:118\n#10 _PyEval_Vector (tstate=0x555555d99c08 \u003c_PyRuntime+360664\u003e, func=0x7ffff75e9190, locals=0x0, args=0x7fffffffb310, argcount=2, kwnames=0x0) at Python/ceval.c:2130\n#11 0x00005555556a2ebe in _PyObject_VectorcallTstate (tstate=0x555555d99c08 \u003c_PyRuntime+360664\u003e, callable=callable@entry=0x7ffff75e9190, args=args@entry=0x7fffffffb310,\n    nargsf=nargsf@entry=2, kwnames=kwnames@entry=0x0) at ./Include/internal/pycore_call.h:144\n#12 0x00005555556a625a in object_vacall (tstate=tstate@entry=0x555555d99c08 \u003c_PyRuntime+360664\u003e, base=base@entry=0x0, callable=callable@entry=0x7ffff75e9190,\n    vargs=vargs@entry=0x7fffffffb460) at Objects/call.c:823\n#13 0x00005555556a5f0b in PyObject_CallMethodObjArgs (obj=0x7ffff75b08c0, name=0x555555d57470 \u003c_PyRuntime+88384\u003e) at Objects/call.c:960\n#14 0x000055555595136b in import_find_and_load (tstate=tstate@entry=0x555555d99c08 \u003c_PyRuntime+360664\u003e, abs_name=abs_name@entry=0x7ffff74f86d0) at Python/import.c:4125\n#15 0x0000555555950f66 in PyImport_ImportModuleLevelObject (name=name@entry=0x7ffff74f86d0, globals=globals@entry=0x7ffff746a4b0, locals=locals@entry=0x7ffff746a4b0,\n    fromlist=0x7ffff7477cf0, level=level@entry=0) at Python/import.c:4241\n#16 0x00005555558f7265 in _PyEval_ImportNameWithImport (tstate=tstate@entry=0x555555d99c08 \u003c_PyRuntime+360664\u003e, import_func=0x7ffff75be9f0, globals=globals@entry=0x7ffff746a4b0,\n    locals=locals@entry=0x7ffff746a4b0, name=name@entry=0x7ffff74f86d0, fromlist=fromlist@entry=0x7ffff7477cf0, level=0x555555d49188 \u003c_PyRuntime+30296\u003e) at Python/ceval.c:2975\n#17 0x00005555558848bf in _PyEval_ImportName (tstate=tstate@entry=0x555555d99c08 \u003c_PyRuntime+360664\u003e, builtins=0x7ffff75be930, globals=0x7ffff746a4b0, locals=0x7ffff746a4b0,\n    name=0x7ffff74f86d0, fromlist=0x7ffff7477cf0, level=0x555555d49188 \u003c_PyRuntime+30296\u003e) at Python/ceval.c:2954\n#18 0x000055555586141a in _PyEval_EvalFrameDefault (tstate=tstate@entry=0x555555d99c08 \u003c_PyRuntime+360664\u003e, frame=\u003coptimized out\u003e, frame@entry=0x7ffff7fa7020, throwflag=throwflag@entry=0)\n    at Python/generated_cases.c.h:6460\n#19 0x000055555583f08b in _PyEval_EvalFrame (tstate=0x555555d99c08 \u003c_PyRuntime+360664\u003e, frame=0x7ffff7fa7020, throwflag=0) at ./Include/internal/pycore_ceval.h:118\n#20 _PyEval_Vector (tstate=tstate@entry=0x555555d99c08 \u003c_PyRuntime+360664\u003e, func=func@entry=0x7ffff7466690, locals=locals@entry=0x7ffff746a4b0, args=args@entry=0x0,\n    argcount=argcount@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:2130\n#21 0x000055555583ee1e in PyEval_EvalCode (co=co@entry=0x555555f3baf0, globals=globals@entry=0x7ffff746a4b0, locals=locals@entry=0x7ffff746a4b0) at Python/ceval.c:686\n#22 0x00005555559c8f8e in run_eval_code_obj (tstate=0x555555d99c08 \u003c_PyRuntime+360664\u003e, co=co@entry=0x555555f3baf0, globals=globals@entry=0x7ffff746a4b0, locals=locals@entry=0x7ffff746a4b0)\n    at Python/pythonrun.c:1368\n#23 0x00005555559c8adb in run_mod (mod=mod@entry=0x555555f43b30, filename=filename@entry=0x7ffff74e8580, globals=globals@entry=0x7ffff746a4b0, locals=locals@entry=0x7ffff746a4b0,\n    flags=0x7fffffffc950, arena=arena@entry=0x7ffff74dad40, interactive_src=0x0, generate_new_source=0) at Python/pythonrun.c:1471\n```\n\nFound using [cpython-review-toolkit](https://github.com/devdanzin/cpython-review-toolkit) with Claude Opus 4.6, using the `/cpython-review-toolkit:explore Modules/_zoneinfo.c all deep` command.\n\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.15.0a7+ (heads/main:e0f7c1097e1, Mar 17 2026, 18:10:52) [Clang 21.1.2 (2ubuntu6)]\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-146117\n* gh-146119\n* gh-146124\n* gh-146132\n* gh-146138\n* gh-146165\n* gh-146223\n* gh-146224\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/devdanzin","@type":"Person","name":"devdanzin"},"datePublished":"2026-03-17T23:23:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/146092/cpython/issues/146092"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9243a2d3-83b1-5569-6344-de88a18de3ce
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id991E:28B9FB:160DD59:1F29515:6A50BA2E
html-safe-noncea081e9b948c808018a9eb8ef3464985424bcc0e26e048617ce25cd893600e0a1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTFFOjI4QjlGQjoxNjBERDU5OjFGMjk1MTU6NkE1MEJBMkUiLCJ2aXNpdG9yX2lkIjoiNDgyNzY4NDU3Njk3NjQ4NDkxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac506081661fcf0832fb4cfb207109319a31cb31e44f019b2ef4172c797e6b00b7
hovercard-subject-tagissue:4091737007
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/146092/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3c8ffff2705b0809daf0aa37eb8d12bcbafd687c3f1fc19aa5e12bbc3f9469e3/python/cpython/issues/146092
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3c8ffff2705b0809daf0aa37eb8d12bcbafd687c3f1fc19aa5e12bbc3f9469e3/python/cpython/issues/146092
og:image:altCrash report What happened? It's possible to cause assertion errors due to calls returning NULL on OOM in _zoneinfo. Automated diagnosis: Multiple PyMem_Malloc/PyMem_Calloc calls in load_data (incl...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedevdanzin
hostnamegithub.com
expected-hostnamegithub.com
None72b13e0e8d0319acdd27a145cfe73f4f06c791713d0ac4690e41fb68ad28cac0
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
release08e79d53fc070870d5b168356afebb1e286a2ffe
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/146092#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F146092
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%2F146092
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/146092
Reloadhttps://github.com/python/cpython/issues/146092
Reloadhttps://github.com/python/cpython/issues/146092
Please reload this pagehttps://github.com/python/cpython/issues/146092
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/146092
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
Missing PyErr_NoMemory in _zoneinfo load_data and ts_to_localhttps://github.com/python/cpython/issues/146092#top
3.13bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15pre-release feature fixes, bugs 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/devdanzin
devdanzinhttps://github.com/devdanzin
on Mar 17, 2026https://github.com/python/cpython/issues/146092#issue-4091737007
cpython-review-toolkithttps://github.com/devdanzin/cpython-review-toolkit
gh-146092: Fix error handling in _BINARY_OP_ADD_UNICODE opcode #146117https://github.com/python/cpython/pull/146117
[3.14] gh-146092: Fix error handling in _BINARY_OP_ADD_FLOAT opcode #146119https://github.com/python/cpython/pull/146119
gh-146092: Handle _PyFrame_GetFrameObject() failures properly #146124https://github.com/python/cpython/pull/146124
[3.14] gh-146092: Handle _PyFrame_GetFrameObject() failures properly (#146124) #146132https://github.com/python/cpython/pull/146132
[3.13] gh-146092: Handle _PyFrame_GetFrameObject() failures properly (GH-146124) (GH-146132) #146138https://github.com/python/cpython/pull/146138
gh-146092: Raise MemoryError on allocation failure in _zoneinfo #146165https://github.com/python/cpython/pull/146165
[3.14] gh-146092: Raise MemoryError on allocation failure in _zoneinfo (GH-146165) #146223https://github.com/python/cpython/pull/146223
[3.13] gh-146092: Raise MemoryError on allocation failure in _zoneinfo (GH-146165) #146224https://github.com/python/cpython/pull/146224
3.13bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15pre-release feature fixes, bugs 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.