GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-151040: Fix `test_c_stack_unwind` on riscv64 by IvyXu420 · Pull Request #152370 · python/cpython

Conversation

@IvyXu420

@IvyXu420 IvyXu420 commented Jun 27, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

According to https://riscv-non-isa.github.io/riscv-elf-psabi-doc/#_frame_pointer_convention, riscv64 puts the return address at fp[-1], and the previous frame pointer at fp[-2].

I verified this fix by using GCC to build CPython, and successfully ran ./python -m test -v test_c_stack_unwind via Docker and QEMU (docker run --platform linux/riscv64 riscv64/ubuntu:24.04). Tests passed.

  • Issue: 3.15.0b2, Fedora 44, riscv64: failing test: test_c_stack_unwind #151040

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@IvyXu420
Fix test_c_stack_unwind on RISC-V
4163336
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jun 27, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jun 27, 2026
3.15.0b2, Fedora 44, riscv64: failing test: test_c_stack_unwind #151040
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Jun 27, 2026
@StanFromIreland

StanFromIreland commented Jun 29, 2026

Copy link
Copy Markdown
Member

Since this is the same as #152241, closing in favour of the older PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland StanFromIreland closed this Jun 29, 2026
@StanFromIreland StanFromIreland mentioned this pull request Jun 29, 2026
gh-152240: Fix test_c_stack_unwind on Linux LoongArch builds #152241
Merged
@StanFromIreland StanFromIreland reopened this Jun 29, 2026
@StanFromIreland

StanFromIreland commented Jun 29, 2026

Copy link
Copy Markdown
Member

Ok, #152241 was merged. Please merge it with your addition here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Jun 29, 2026

Copy link
Copy Markdown
Member

Since this is the same as #152241, closing in favour of the older PR.

IMO LoongArch is different enough from RISC-V that it deserves to have its own code path, see: https://en.wikipedia.org/wiki/Loongson#LoongArch. I merged the LoongArch PR (PR gh-152241).

Can you please solve the merge conflict on your PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@IvyXu420
Merge branch 'main' into fix-151040
6280ab1
@IvyXu420

IvyXu420 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

I have resolved the merge conflicts. I believe the issue reported in #150919 will also be fixed by this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

StanFromIreland commented Jun 29, 2026

Copy link
Copy Markdown
Member

!buildbot riscv64

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Jun 29, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @StanFromIreland for commit 6280ab1 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F152370%2Fmerge

The command will test the builders whose names match following regular expression: riscv64

The builders matched are:

  • riscv64 Ubuntu23 PR
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland StanFromIreland added the skip news label Jun 29, 2026
@IvyXu420

IvyXu420 commented Jun 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

test_c_stack_unwind passed on the buildbot, but the CI failed on test_sys . This has also occurred in previous riscv64 builds and is unrelated to this PR.

However, I cannot reproduce the test_sys failure locally using QEMU riscv64. It may be caused by the low performance of the buildbot's machine.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Jun 29, 2026

Copy link
Copy Markdown
Member

The test_sys failure is a timeout on running test_remote_exec_deleted_static_executable(). The test has a hardcoded timeout of 10 seconds.

0:46:03 load avg: 0.37 mem: 21.1 MiB [1/1/1] test_sys failed (1 error) (1 min 1 sec)
Re-running test_sys in verbose mode (matching: test_remote_exec_deleted_static_executable)
test_remote_exec_deleted_static_executable (test.test_sys.TestRemoteExec.test_remote_exec_deleted_static_executable)
Test remote exec when the target static executable was deleted. ... ERROR
/home/ubuntu/buildarea/pull_request.onder-riscv64.installed/build/target/lib/python3.16/unittest/case.py:690: ResourceWarning: unclosed <socket.socket fd=3, family=2, type=1, proto=0, laddr=('127.0.0.1', 55335)>
  with outcome.testPartExecutor(self):
ResourceWarning: Enable tracemalloc to get the object allocation traceback
======================================================================
ERROR: test_remote_exec_deleted_static_executable (test.test_sys.TestRemoteExec.test_remote_exec_deleted_static_executable)
Test remote exec when the target static executable was deleted.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ubuntu/buildarea/pull_request.onder-riscv64.installed/build/target/lib/python3.16/test/test_sys.py", line 2313, in test_remote_exec_deleted_static_executable
    self._run_remote_exec_with_deleted_mapping(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        copied_python, python_args=['-S'],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        python_executable=copied_python)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/pull_request.onder-riscv64.installed/build/target/lib/python3.16/test/test_sys.py", line 2116, in _run_remote_exec_with_deleted_mapping
    returncode, stdout, stderr = self._run_remote_exec_test(
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        script, after_ready=delete_loaded_mapping, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/pull_request.onder-riscv64.installed/build/target/lib/python3.16/test/test_sys.py", line 2078, in _run_remote_exec_test
    client_socket, _ = server_socket.accept()
                       ~~~~~~~~~~~~~~~~~~~~^^
  File "/home/ubuntu/buildarea/pull_request.onder-riscv64.installed/build/target/lib/python3.16/socket.py", line 299, in accept
    fd, addr = self._accept()
               ~~~~~~~~~~~~^^
TimeoutError: timed out
----------------------------------------------------------------------
Ran 1 test in 60.256s
FAILED (errors=1)
test test_sys failed
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner added the needs backport to 3.15 bugs and security fixes label Jun 29, 2026
@vstinner
vstinner merged commit 1b0c05f into python:main Jun 29, 2026
74 of 75 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Jun 29, 2026

Copy link
Copy Markdown

Thanks @ByteFlowing1337 for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Jun 29, 2026
@miss-islington-app

miss-islington-app Bot commented Jun 29, 2026

Copy link
Copy Markdown

Sorry, @ByteFlowing1337 and @vstinner, I could not cleanly backport this to 3.15 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 1b0c05f14807a43d070127b3d8eac1af8de27f28 3.15
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned vstinner Jun 29, 2026
@vstinner

vstinner commented Jun 29, 2026

Copy link
Copy Markdown
Member

Thanks for the fix @ByteFlowing1337!

For the backport to 3.15, I will wait until #152578 is merged to 3.15 first.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented Jul 1, 2026

Copy link
Copy Markdown

GH-152819 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jul 1, 2026
@StanFromIreland

StanFromIreland commented Jul 1, 2026

Copy link
Copy Markdown
Member

I don't know when that will happen, hopefully soon, but to not forget about this I took care of it now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland added a commit that referenced this pull request Jul 1, 2026
@StanFromIreland @IvyXu420
[3.15] gh-151040: Fix test_c_stack_unwind on RISC-V (GH-152370) (#1…
6bbc28b
…52819)

(cherry picked from commit 1b0c05f)

Co-authored-by: Ivy Xu <[email protected]>
@IvyXu420
IvyXu420 deleted the fix-151040 branch July 11, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@vstinner vstinner

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@IvyXu420 @StanFromIreland @vstinner @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.