René's URL Explorer Experiment


Title: gh-146427: Fix use-after-free when clearing interpreter's queue items by aisk · Pull Request #146428 · python/cpython · GitHub

Open Graph Title: gh-146427: Fix use-after-free when clearing interpreter's queue items by aisk · Pull Request #146428 · python/cpython

X Title: gh-146427: Fix use-after-free when clearing interpreter's queue items by aisk · Pull Request #146428 · python/cpython

Description: Test code: from concurrent import interpreters from concurrent.interpreters import _queues as queues q = queues.create() q.put(1) interp = interpreters.create() interp.exec(f"from concurrent.interpreters import _queues as queues; queues.Queue({q.id}).put(2, unbounditems=queues.UNBOUND_REMOVE)") # del interp interp.close() q.put(3) Run with ASan before this change: ./python.exe /tmp/test_queue_uaf.py python.exe(30924,0x7ff855eaedc0) malloc: nano zone abandoned due to inability to reserve vm space. ================================================================= ==30924==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000014758 at pc 0x0002d78f050f bp 0x7ff7b18a0b90 sp 0x7ff7b18a0b88 WRITE of size 8 at 0x603000014758 thread T0 #0 0x2d78f050e in _interpqueues_put _interpqueuesmodule.c.h:265 #1 0x10eb6d600 in _Py_BuiltinCallFastWithKeywords_StackRefSteal ceval.c:859 #2 0x10eb75727 in _PyEval_EvalFrameDefault generated_cases.c.h:2444 #3 0x10eb6ab2e in PyEval_EvalCode ceval.c:686 #4 0x10ed09431 in run_mod pythonrun.c:1472 #5 0x10ed02915 in _PyRun_SimpleFileObject pythonrun.c:518 #6 0x10ed01d12 in _PyRun_AnyFileObject pythonrun.c:81 #7 0x10ed7d9d9 in Py_RunMain main.c:795 #8 0x10ed7f166 in pymain_main main.c:825 #9 0x10ed7f470 in Py_BytesMain main.c:849 #10 0x7ff81410352f in start+0xbef (dyld:x86_64+0xfffffffffffe652f) 0x603000014758 is located 24 bytes inside of 32-byte region [0x603000014740,0x603000014760) freed by thread T0 here: #0 0x10fc07956 in free+0xa6 (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0xdd956) #1 0x2d78f486a in clear_interpreter _interpqueuesmodule.c:1470 #2 0x10ed9975e in _PyAtExit_Fini atexitmodule.c:98 #3 0x10ecf9aa3 in interpreter_clear pystate.c:871 #4 0x10ecee073 in finalize_interp_clear pylifecycle.c:2026 #5 0x10eceabec in Py_EndInterpreter pylifecycle.c:2707 #6 0x10ec150bb in _PyXI_EndInterpreter crossinterp.c:3298 #7 0x2d76e8a0f in _interpreters_destroy _interpretersmodule.c.h:162 #8 0x10e784599 in PyObject_Vectorcall call.c:327 #9 0x10eb6c631 in _Py_VectorCallInstrumentation_StackRefSteal ceval.c:775 #10 0x10eb8b3e9 in _PyEval_EvalFrameDefault generated_cases.c.h:3222 #11 0x10eb6ab2e in PyEval_EvalCode ceval.c:686 #12 0x10ed09431 in run_mod pythonrun.c:1472 #13 0x10ed02915 in _PyRun_SimpleFileObject pythonrun.c:518 #14 0x10ed01d12 in _PyRun_AnyFileObject pythonrun.c:81 #15 0x10ed7d9d9 in Py_RunMain main.c:795 #16 0x10ed7f166 in pymain_main main.c:825 #17 0x10ed7f470 in Py_BytesMain main.c:849 #18 0x7ff81410352f in start+0xbef (dyld:x86_64+0xfffffffffffe652f) previously allocated by thread T0 here: #0 0x10fc0780d in malloc+0x9d (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0xdd80d) #1 0x2d78f017e in _interpqueues_put _interpqueuesmodule.c.h:265 #2 0x10e784599 in PyObject_Vectorcall call.c:327 #3 0x10eb6c631 in _Py_VectorCallInstrumentation_StackRefSteal ceval.c:775 #4 0x10eb9100a in _PyEval_EvalFrameDefault generated_cases.c.h:1841 #5 0x10eb6ab2e in PyEval_EvalCode ceval.c:686 #6 0x2d76ec73b in _run_in_interpreter _interpretersmodule.c:690 #7 0x2d76e9b83 in _interpreters_exec _interpretersmodule.c.h:438 #8 0x10e784599 in PyObject_Vectorcall call.c:327 #9 0x10eb6c631 in _Py_VectorCallInstrumentation_StackRefSteal ceval.c:775 #10 0x10eb8b3e9 in _PyEval_EvalFrameDefault generated_cases.c.h:3222 #11 0x10eb6ab2e in PyEval_EvalCode ceval.c:686 #12 0x10ed09431 in run_mod pythonrun.c:1472 #13 0x10ed02915 in _PyRun_SimpleFileObject pythonrun.c:518 #14 0x10ed01d12 in _PyRun_AnyFileObject pythonrun.c:81 #15 0x10ed7d9d9 in Py_RunMain main.c:795 #16 0x10ed7f166 in pymain_main main.c:825 #17 0x10ed7f470 in Py_BytesMain main.c:849 #18 0x7ff81410352f in start+0xbef (dyld:x86_64+0xfffffffffffe652f) SUMMARY: AddressSanitizer: heap-use-after-free _interpqueuesmodule.c.h:265 in _interpqueues_put Shadow bytes around the buggy address: 0x603000014480: fd fa fa fa fd fd fd fa fa fa fd fd fd fd fa fa 0x603000014500: fd fd fd fa fa fa fd fd fd fa fa fa fd fd fd fa 0x603000014580: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd 0x603000014600: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa 0x603000014680: fd fd fd fd fa fa fd fd fd fa fa fa fd fd fd fd =>0x603000014700: fa fa fd fd fd fa fa fa fd fd fd[fd]fa fa 00 00 0x603000014780: 00 00 fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x603000014800: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x603000014880: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x603000014900: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x603000014980: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==30924==ABORTING fish: Job 1, './python.exe /tmp/test_queue_ua…' terminated by signal SIGABRT (Abort) After this change, runs without crash or error. Issue: gh-146427

Open Graph Description: Test code: from concurrent import interpreters from concurrent.interpreters import _queues as queues q = queues.create() q.put(1) interp = interpreters.create() interp.exec(f"from concurrent...

X Description: Test code: from concurrent import interpreters from concurrent.interpreters import _queues as queues q = queues.create() q.put(1) interp = interpreters.create() interp.exec(f"from concur...

Opengraph URL: https://github.com/python/cpython/pull/146428

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:4c1accf0-cfc1-94eb-5db2-b085d95f1645
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA838:21AFAE:C783:105B2:6A52BAC0
html-safe-nonce2a8934194757812debccf2967ce055d9d1bd52daf375f78a3556b07299f52e14
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODM4OjIxQUZBRTpDNzgzOjEwNUIyOjZBNTJCQUMwIiwidmlzaXRvcl9pZCI6Ijg5MjQ2NjM2OTQ2MzEyODc0ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8bf197ba06279738b2a28e4c2a8f285d532ab9b814d1f6755a6ee8dc37238ef0
hovercard-subject-tagpull_request:3446213155
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/146428/files
twitter:imagehttps://avatars.githubusercontent.com/u/699636?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/699636?s=400&v=4
og:image:altTest code: from concurrent import interpreters from concurrent.interpreters import _queues as queues q = queues.create() q.put(1) interp = interpreters.create() interp.exec(f"from concurrent...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
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/pull/146428/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F146428%2Ffiles
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%2Fpull%2F146428%2Ffiles
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%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/146428/files
Reloadhttps://github.com/python/cpython/pull/146428/files
Reloadhttps://github.com/python/cpython/pull/146428/files
Please reload this pagehttps://github.com/python/cpython/pull/146428/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/146428/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
aiskhttps://github.com/aisk
python:mainhttps://github.com/python/cpython/tree/main
aisk:interp-queue-uafhttps://github.com/aisk/cpython/tree/interp-queue-uaf
Conversation 1 https://github.com/python/cpython/pull/146428
Commits 3 https://github.com/python/cpython/pull/146428/commits
Checks 49 https://github.com/python/cpython/pull/146428/checks
Files changed https://github.com/python/cpython/pull/146428/files
Please reload this pagehttps://github.com/python/cpython/pull/146428/files
gh-146427: Fix use-after-free when clearing interpreter's queue items https://github.com/python/cpython/pull/146428/files#top
Show all changes 3 commits https://github.com/python/cpython/pull/146428/files
e66552c Fix use-after-free when clearing interpreter's queue items aisk Mar 25, 2026 https://github.com/python/cpython/pull/146428/commits/e66552c807702ca08190ef51e30906e78ac0ca60
0fee2ab 📜🤖 Added by blurb_it. blurb-it[bot] Mar 25, 2026 https://github.com/python/cpython/pull/146428/commits/0fee2ab18d3b99928e0094dc18ae8e2bd0d76dca
7a9cef6 Fix news entry aisk Mar 25, 2026 https://github.com/python/cpython/pull/146428/commits/7a9cef64e4c22224ea242177c1f475916be2463f
Clear filters https://github.com/python/cpython/pull/146428/files
Please reload this pagehttps://github.com/python/cpython/pull/146428/files
Please reload this pagehttps://github.com/python/cpython/pull/146428/files
2026-03-25-16-45-31.gh-issue-146427.sbxyZO.rst https://github.com/python/cpython/pull/146428/files#diff-a1213a7bf50076683d584226bead259bb8c2aa942edff52b9c92519dae05881e
_interpqueuesmodule.c https://github.com/python/cpython/pull/146428/files#diff-1ab0cbc8fae26c3998a1ce3a8ebc7d23759c881f33f783c9c5382b27e886e731
Misc/NEWS.d/next/Core_and_Builtins/2026-03-25-16-45-31.gh-issue-146427.sbxyZO.rsthttps://github.com/python/cpython/pull/146428/files#diff-a1213a7bf50076683d584226bead259bb8c2aa942edff52b9c92519dae05881e
View file https://github.com/python/cpython/blob/7a9cef64e4c22224ea242177c1f475916be2463f/Misc/NEWS.d/next/Core_and_Builtins/2026-03-25-16-45-31.gh-issue-146427.sbxyZO.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/146428/{{ revealButtonHref }}
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L349
Modules/_interpqueuesmodule.chttps://github.com/python/cpython/pull/146428/files#diff-1ab0cbc8fae26c3998a1ce3a8ebc7d23759c881f33f783c9c5382b27e886e731
View file https://github.com/python/cpython/blob/7a9cef64e4c22224ea242177c1f475916be2463f/Modules/_interpqueuesmodule.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/146428/{{ revealButtonHref }}
https://github.com/python/cpython/pull/146428/files#diff-1ab0cbc8fae26c3998a1ce3a8ebc7d23759c881f33f783c9c5382b27e886e731
https://github.com/python/cpython/pull/146428/files#diff-1ab0cbc8fae26c3998a1ce3a8ebc7d23759c881f33f783c9c5382b27e886e731
Please reload this pagehttps://github.com/python/cpython/pull/146428/files
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.