René's URL Explorer Experiment


Title: gh-149202: Fix frame pointer unwinding on s390x and ARM by pablogsal · Pull Request #149362 · python/cpython · GitHub

Open Graph Title: gh-149202: Fix frame pointer unwinding on s390x and ARM by pablogsal · Pull Request #149362 · python/cpython

X Title: gh-149202: Fix frame pointer unwinding on s390x and ARM by pablogsal · Pull Request #149362 · python/cpython

Description: This was particularly hard to get right :( -fno-omit-frame-pointer is not enough to make every target walkable by the simple manual frame pointer unwinder. The helper used by test_frame_pointer_unwind used to assume the frame pointer named a two-word record where fp[0] was the previous frame pointer and fp[1] was the return address. That is only the generic layout used by some targets. This patch keeps that default, but moves the slots behind named offsets so architecture-specific layouts can describe where the backchain and return address really live. On s390x, GCC and Clang do not emit a usable backchain unless -mbackchain is also enabled. Without it, the unwinder stops at the current C frame and the test reports no Python frames. Once backchains are present, the helper must also stop at the current thread's known C stack bounds; otherwise it can follow the final backchain far enough to dereference an invalid frame and segfault. For Linux s390x backchain frames, the documented z/Architecture stack-frame layout saves r14, the return-address register, at byte offset 112 from the frame pointer, so read the return address from that named slot instead of fp[1]. On 32-bit ARM, GCC defaults to Thumb mode on common armhf toolchains. The Thumb prologue keeps the saved frame pointer and link register at offsets that depend on the generated frame, which breaks the fp[0]/fp[1] walk used by the helper. Use -marm when it is supported for frame-pointer builds, and teach the helper the GCC ARM-mode slots where the previous frame pointer is at fp[-1] and the saved LR return address is at fp[0]. Issue: gh-149202

Open Graph Description: This was particularly hard to get right :( -fno-omit-frame-pointer is not enough to make every target walkable by the simple manual frame pointer unwinder. The helper used by test_frame_pointer_unw...

X Description: This was particularly hard to get right :( -fno-omit-frame-pointer is not enough to make every target walkable by the simple manual frame pointer unwinder. The helper used by test_frame_pointer_unw...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6de89434-0ad6-02df-174f-07780034f909
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8B9E:285800:2CAACF:3ED9DF:6AECF8CD
html-safe-nonce710f3e0ebf82c7a7b68229e35a7b3a6245aa9b376054ea3efdb615e0080d3211
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjlFOjI4NTgwMDoyQ0FBQ0Y6M0VEOURGOjZBRUNGOENEIiwidmlzaXRvcl9pZCI6IjU3NjIwMzIzOTEyODY0ODcyNDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4aef8f3dc9ee9edf12837bad7cfa3db70805fcf4607b7556203fdcd08e16d1b6
hovercard-subject-tagpull_request:3624235780
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/149362/files
twitter:imagehttps://avatars.githubusercontent.com/u/11718525?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/11718525?s=400&v=4
og:image:altThis was particularly hard to get right :( -fno-omit-frame-pointer is not enough to make every target walkable by the simple manual frame pointer unwinder. The helper used by test_frame_pointer_unw...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None76be9fd7856c8274dcfc751356c6c2dc12374a9696cbae1046752a000b9a5ca9
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
releasef3ae5cc8182dfd6f403dc93a15ed8017d5ee795b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/149362/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F149362%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%2F149362%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/149362/files
Reloadhttps://github.com/python/cpython/pull/149362/files
Reloadhttps://github.com/python/cpython/pull/149362/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.3k (2.3k)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/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
encukouhttps://github.com/encukou
python:mainhttps://github.com/python/cpython/tree/main
pablogsal:gh-149202-2https://github.com/pablogsal/cpython/tree/gh-149202-2
Conversation 27 https://github.com/python/cpython/pull/149362
Commits 10 https://github.com/python/cpython/pull/149362/commits
Checks 72 https://github.com/python/cpython/pull/149362/checks
Files changed https://github.com/python/cpython/pull/149362/files
Please reload this pagehttps://github.com/python/cpython/pull/149362/files
gh-149202: Fix frame pointer unwinding on s390x and ARM https://github.com/python/cpython/pull/149362/files#top
Show all changes 10 commits https://github.com/python/cpython/pull/149362/files
c68855d gh-149202: Fix frame pointer unwinding on s390x and ARM pablogsal May 4, 2026 https://github.com/python/cpython/pull/149362/commits/c68855d9a34b9151c7f36e28b7796fba65c63a06
ad2c814 Advertise frame pointer support via _Py_WITH_FRAME_POINTERS encukou May 5, 2026 https://github.com/python/cpython/pull/149362/commits/ad2c814de509ea64c539bd2c7cd34730f57fc006
242a58e Use -mbackchain only on s390x encukou May 5, 2026 https://github.com/python/cpython/pull/149362/commits/242a58e612350ce7ecc104b1444ebccabfdd6207
9b74182 Adjust comment encukou May 5, 2026 https://github.com/python/cpython/pull/149362/commits/9b741822edf152309d39512a3903d78599904b48
efb829e Merge in the main branch encukou May 5, 2026 https://github.com/python/cpython/pull/149362/commits/efb829e272d31c23eb86cb3e0f225a24c66fb1ae
a612c88 Regen configure encukou May 5, 2026 https://github.com/python/cpython/pull/149362/commits/a612c889e2ea83fcd4c7d659ad600cb892d0b06c
955261c Merge in the main branch encukou May 5, 2026 https://github.com/python/cpython/pull/149362/commits/955261cfa82001baf5459120f3a3fc564c5db5b1
92ee35e Merge in the main branch encukou May 6, 2026 https://github.com/python/cpython/pull/149362/commits/92ee35e4ca6a6ba6a1f33317a54a025423f4e8af
02617af Adjust docs & comment encukou May 6, 2026 https://github.com/python/cpython/pull/149362/commits/02617afe906b0b447f9b0729b411eee299d37771
4720bc9 Apply suggestion from @vstinner encukou May 6, 2026 https://github.com/python/cpython/pull/149362/commits/4720bc9fa3555ef389da2c19109344c2f8db906e
Clear filters https://github.com/python/cpython/pull/149362/files
Please reload this pagehttps://github.com/python/cpython/pull/149362/files
Please reload this pagehttps://github.com/python/cpython/pull/149362/files
perf_profiling.rst https://github.com/python/cpython/pull/149362/files#diff-3a87b67fbb1a25a5f143ed161778241a9f6285dcc2aa4787c957a2674b6bf70c
configure.rst https://github.com/python/cpython/pull/149362/files#diff-3d679da2b3a01e3744dc65d731bb0a896c07e60f3cfdb19911afab3c146a80ef
3.15.rst https://github.com/python/cpython/pull/149362/files#diff-bd7a9c5b54eeb2b40e6db5e48e8d79d309d8738e776a40918773c6840189edf9
test_frame_pointer_unwind.py https://github.com/python/cpython/pull/149362/files#diff-1551b22c7da9f10f5bcb318686edc665ca5fca955c05efae7db509ae9ad12d0b
2026-04-05-16-10-00.gh-issue-149202.W8sQeR.rst https://github.com/python/cpython/pull/149362/files#diff-1195ccfa00bebc77b25094c2f5968a501af69f0cd0a34943e8ab7155081e2795
_testinternalcapi.c https://github.com/python/cpython/pull/149362/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
configure https://github.com/python/cpython/pull/149362/files#diff-90d08e583c4c9c6f391b2ae90f819f600a6326928ea9512c9e0c6d98e9f29ac2
configure.ac https://github.com/python/cpython/pull/149362/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
pyconfig.h.in https://github.com/python/cpython/pull/149362/files#diff-f67052280dd3a53f0e713339632a8c10bc2e420e24a70852d83aeb50d495835f
Doc/howto/perf_profiling.rsthttps://github.com/python/cpython/pull/149362/files#diff-3a87b67fbb1a25a5f143ed161778241a9f6285dcc2aa4787c957a2674b6bf70c
View file https://github.com/pablogsal/cpython/blob/4720bc9fa3555ef389da2c19109344c2f8db906e/Doc/howto/perf_profiling.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/149362/{{ revealButtonHref }}
https://github.com/python/cpython/pull/149362/files#diff-3a87b67fbb1a25a5f143ed161778241a9f6285dcc2aa4787c957a2674b6bf70c
https://github.com/python/cpython/pull/149362/files#diff-3a87b67fbb1a25a5f143ed161778241a9f6285dcc2aa4787c957a2674b6bf70c
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L84
Doc/using/configure.rsthttps://github.com/python/cpython/pull/149362/files#diff-3d679da2b3a01e3744dc65d731bb0a896c07e60f3cfdb19911afab3c146a80ef
View file https://github.com/pablogsal/cpython/blob/4720bc9fa3555ef389da2c19109344c2f8db906e/Doc/using/configure.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/149362/{{ revealButtonHref }}
https://github.com/python/cpython/pull/149362/files#diff-3d679da2b3a01e3744dc65d731bb0a896c07e60f3cfdb19911afab3c146a80ef
https://github.com/python/cpython/pull/149362/files#diff-3d679da2b3a01e3744dc65d731bb0a896c07e60f3cfdb19911afab3c146a80ef
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L116
Doc/whatsnew/3.15.rsthttps://github.com/python/cpython/pull/149362/files#diff-bd7a9c5b54eeb2b40e6db5e48e8d79d309d8738e776a40918773c6840189edf9
View file https://github.com/pablogsal/cpython/blob/4720bc9fa3555ef389da2c19109344c2f8db906e/Doc/whatsnew/3.15.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/149362/{{ revealButtonHref }}
https://github.com/python/cpython/pull/149362/files#diff-bd7a9c5b54eeb2b40e6db5e48e8d79d309d8738e776a40918773c6840189edf9
https://github.com/python/cpython/pull/149362/files#diff-bd7a9c5b54eeb2b40e6db5e48e8d79d309d8738e776a40918773c6840189edf9
Lib/test/test_frame_pointer_unwind.pyhttps://github.com/python/cpython/pull/149362/files#diff-1551b22c7da9f10f5bcb318686edc665ca5fca955c05efae7db509ae9ad12d0b
View file https://github.com/pablogsal/cpython/blob/4720bc9fa3555ef389da2c19109344c2f8db906e/Lib/test/test_frame_pointer_unwind.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/149362/{{ revealButtonHref }}
https://github.com/python/cpython/pull/149362/files#diff-1551b22c7da9f10f5bcb318686edc665ca5fca955c05efae7db509ae9ad12d0b
https://github.com/python/cpython/pull/149362/files#diff-1551b22c7da9f10f5bcb318686edc665ca5fca955c05efae7db509ae9ad12d0b
Misc/NEWS.d/next/Core_and_Builtins/2026-04-05-16-10-00.gh-issue-149202.W8sQeR.rsthttps://github.com/python/cpython/pull/149362/files#diff-1195ccfa00bebc77b25094c2f5968a501af69f0cd0a34943e8ab7155081e2795
View file https://github.com/pablogsal/cpython/blob/4720bc9fa3555ef389da2c19109344c2f8db906e/Misc/NEWS.d/next/Core_and_Builtins/2026-04-05-16-10-00.gh-issue-149202.W8sQeR.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/149362/{{ revealButtonHref }}
Modules/_testinternalcapi.chttps://github.com/python/cpython/pull/149362/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
View file https://github.com/pablogsal/cpython/blob/4720bc9fa3555ef389da2c19109344c2f8db906e/Modules/_testinternalcapi.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/149362/{{ revealButtonHref }}
https://github.com/python/cpython/pull/149362/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/149362/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/149362/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/149362/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/149362/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/149362/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/149362/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/pull/149362/files#diff-687f4a736f1f6ad4b6cd4ff65c8e0113408304e8d65530dbd41b3f59a081a126
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L84
configurehttps://github.com/python/cpython/pull/149362/files#diff-90d08e583c4c9c6f391b2ae90f819f600a6326928ea9512c9e0c6d98e9f29ac2
View file https://github.com/pablogsal/cpython/blob/4720bc9fa3555ef389da2c19109344c2f8db906e/configure
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/149362/files
Please reload this pagehttps://github.com/python/cpython/pull/149362/files
Please reload this pagehttps://github.com/python/cpython/pull/149362/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.