Skip to content

gh-160253: Fix test_c_stack_unwind manual unwinding on sparc64 - #160255

Open
shalseth wants to merge 1 commit into
python:mainfrom
shalseth:sparc64-c-stack-unwind
Open

shalseth wants to merge 1 commit into
python:mainfrom
shalseth:sparc64-c-stack-unwind

Conversation

@shalseth

@shalseth shalseth commented Oct 22, 2026 •

Copy link
Copy Markdown

Teach the manual frame pointer unwinder in _testinternalcapi the SPARC V9 frame layout. There's no frame record on SPARC: the caller's %fp (biased by 2047) and its return address are in slots 14 and 15 of the register window save area at fp, and they're only in memory after a flushw.

Tested on a SPARC T7-1 and a T4-1 (Linux, GCC 16): ManualStackUnwindTests fails without the change and passes with it, and the unwinder walks all the way down to _start. No change on x86_64.

The GNU backtrace test still fails on sparc64, that's the missing unwind tables from the issue (GCC PR 128091), not this code.

SPARC V9 has no frame record. The caller's %fp (biased by 2047) and return
address are in slots 14 and 15 of the register window save area at fp, and
are only there after the windows have been flushed to the stack.
@python-cla-bot

python-cla-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Oct 22, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@shalseth

Copy link
Copy Markdown
Author

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Please apply skip news to this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant