René's URL Explorer Experiment


Title: gh-134604: Fix tracemalloc crash with subinterpreters by emmatyping · Pull Request #134667 · python/cpython · GitHub

Open Graph Title: gh-134604: Fix tracemalloc crash with subinterpreters by emmatyping · Pull Request #134667 · python/cpython

X Title: gh-134604: Fix tracemalloc crash with subinterpreters by emmatyping · Pull Request #134667 · python/cpython

Description: This is an attempt at resolving a crash when mixing tracemalloc and sub-interpreters I came across recently. My investigation is recorded in the issue #134604 (comment) This PR makes a few changes: modifies tracemalloc to copy the filename of a frame instead of referencing it delays sub-interpreter finalization until after tracemalloc finalizes (optional, but probably a good idea) fixes a typo/duplicated assignment on a line in the tracemalloc_get_frame function adds tests to test__interpreters to ensure that this functions correctly. Should this be backported to 3.13? I suppose subinterpreters can be used there through C APIs, so it might be good to fix this there too. Issue: gh-134604

Open Graph Description: This is an attempt at resolving a crash when mixing tracemalloc and sub-interpreters I came across recently. My investigation is recorded in the issue #134604 (comment) This PR makes a few changes:...

X Description: This is an attempt at resolving a crash when mixing tracemalloc and sub-interpreters I came across recently. My investigation is recorded in the issue #134604 (comment) This PR makes a few changes:...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c6edbacc-68a2-d465-7067-3a85b8c64082
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA4C6:1087D4:321181A:42E9E3E:6B01F82E
html-safe-nonce011d3f6ba413681040cf404c0a9780eb4d1d4d98ce50292b67073ba69b346dac
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNEM2OjEwODdENDozMjExODFBOjQyRTlFM0U6NkIwMUY4MkUiLCJ2aXNpdG9yX2lkIjoiNzUyMjUyODQxNzc4NzU0MTU1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac54e440e04699dd851e2b47e04e3513a358da5cf81eb3e577833467014121a2b0
hovercard-subject-tagpull_request:2542570260
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/134667/files
twitter:imagehttps://avatars.githubusercontent.com/u/9504279?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9504279?s=400&v=4
og:image:altThis is an attempt at resolving a crash when mixing tracemalloc and sub-interpreters I came across recently. My investigation is recorded in the issue #134604 (comment) This PR makes a few changes:...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/134667/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F134667%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F134667%2Ffiles
Sign uphttps://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/134667/files
Reloadhttps://github.com/python/cpython/pull/134667/files
Reloadhttps://github.com/python/cpython/pull/134667/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
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
emmatypinghttps://github.com/emmatyping
python:mainhttps://github.com/python/cpython/tree/main
emmatyping:fix-tracemalloc-with-subinterpretershttps://github.com/emmatyping/cpython/tree/fix-tracemalloc-with-subinterpreters
Conversation 11 https://github.com/python/cpython/pull/134667
Commits 5 https://github.com/python/cpython/pull/134667/commits
Checks 0 https://github.com/python/cpython/pull/134667/checks
Files changed https://github.com/python/cpython/pull/134667/files
Please reload this pagehttps://github.com/python/cpython/pull/134667/files
gh-134604: Fix tracemalloc crash with subinterpreters https://github.com/python/cpython/pull/134667/files#top
Show all changes 5 commits https://github.com/python/cpython/pull/134667/files
029241e Delay subinterpreter finalization to after tracemalloc emmatyping May 25, 2025 https://github.com/python/cpython/pull/134667/commits/029241ed3d4f32c677b39b8225fb2acb1b6c2d4f
f602208 Copy frame filenames in tracemalloc emmatyping May 25, 2025 https://github.com/python/cpython/pull/134667/commits/f602208cfb48bab78a26d16de105c75e2b2c1a1a
daebaff Add test for subinterpreters + tracemalloc emmatyping May 25, 2025 https://github.com/python/cpython/pull/134667/commits/daebaff12693e34b436028926411562c0f04d345
d69d5c0 Add NEWS entry emmatyping May 25, 2025 https://github.com/python/cpython/pull/134667/commits/d69d5c0520c5c9f28666028f7ef63b93e6309a27
911318e Revert "Delay subinterpreter finalization to after tracemalloc" emmatyping May 25, 2025 https://github.com/python/cpython/pull/134667/commits/911318ec868d8f6c198f724e6ca6975cbaefb83c
Clear filters https://github.com/python/cpython/pull/134667/files
Please reload this pagehttps://github.com/python/cpython/pull/134667/files
Please reload this pagehttps://github.com/python/cpython/pull/134667/files
pycore_tracemalloc.h https://github.com/python/cpython/pull/134667/files#diff-1dcb95883ba8c854435490b39f36ac943b7262637b9867dc16b9d804e0ded5fa
test__interpreters.py https://github.com/python/cpython/pull/134667/files#diff-a7c520fd3def33d71197bb4a8dfa83d24d0fbf40c591e6e172d4e333119aefc8
2025-05-25-11-09-35.gh-issue-134604.AGZhQe.rst https://github.com/python/cpython/pull/134667/files#diff-3eb2020f727de61f9b7323a4e2ff734eb8416b829e2d3a460e47da44ebde68f8
tracemalloc.c https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
Include/internal/pycore_tracemalloc.hhttps://github.com/python/cpython/pull/134667/files#diff-1dcb95883ba8c854435490b39f36ac943b7262637b9867dc16b9d804e0ded5fa
View file https://github.com/emmatyping/cpython/blob/911318ec868d8f6c198f724e6ca6975cbaefb83c/Include/internal/pycore_tracemalloc.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/134667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/134667/files#diff-1dcb95883ba8c854435490b39f36ac943b7262637b9867dc16b9d804e0ded5fa
https://github.com/python/cpython/pull/134667/files#diff-1dcb95883ba8c854435490b39f36ac943b7262637b9867dc16b9d804e0ded5fa
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L344
Lib/test/test__interpreters.pyhttps://github.com/python/cpython/pull/134667/files#diff-a7c520fd3def33d71197bb4a8dfa83d24d0fbf40c591e6e172d4e333119aefc8
View file https://github.com/emmatyping/cpython/blob/911318ec868d8f6c198f724e6ca6975cbaefb83c/Lib/test/test__interpreters.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/134667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/134667/files#diff-a7c520fd3def33d71197bb4a8dfa83d24d0fbf40c591e6e172d4e333119aefc8
https://github.com/python/cpython/pull/134667/files#diff-a7c520fd3def33d71197bb4a8dfa83d24d0fbf40c591e6e172d4e333119aefc8
https://github.com/python/cpython/pull/134667/files#diff-a7c520fd3def33d71197bb4a8dfa83d24d0fbf40c591e6e172d4e333119aefc8
Misc/NEWS.d/next/Core_and_Builtins/2025-05-25-11-09-35.gh-issue-134604.AGZhQe.rsthttps://github.com/python/cpython/pull/134667/files#diff-3eb2020f727de61f9b7323a4e2ff734eb8416b829e2d3a460e47da44ebde68f8
View file https://github.com/emmatyping/cpython/blob/911318ec868d8f6c198f724e6ca6975cbaefb83c/Misc/NEWS.d/next/Core_and_Builtins/2025-05-25-11-09-35.gh-issue-134604.AGZhQe.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/134667/{{ revealButtonHref }}
Python/tracemalloc.chttps://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
View file https://github.com/emmatyping/cpython/blob/911318ec868d8f6c198f724e6ca6975cbaefb83c/Python/tracemalloc.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/134667/{{ revealButtonHref }}
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
https://github.com/python/cpython/pull/134667/files#diff-8c15a6d7bef47a331a3ded43da887ac1fb4c53d2374067e0c0ffe1dc32cf9450
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.