gh-151040: Fix test_c_stack_unwind on riscv64#152370
Conversation
|
Since this is the same as #152241, closing in favour of the older PR. |
|
Ok, #152241 was merged. Please merge it with your addition here. |
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? |
|
I have resolved the merge conflicts. I believe the issue reported in #150919 will also be fixed by this PR. |
|
!buildbot riscv64 |
|
🤖 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: The builders matched are:
|
|
However, I cannot reproduce the |
|
The |
|
Thanks @ByteFlowing1337 for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
Sorry, @ByteFlowing1337 and @vstinner, I could not cleanly backport this to |
|
Thanks for the fix @ByteFlowing1337! For the backport to 3.15, I will wait until #152578 is merged to 3.15 first. |
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_unwindvia Docker and QEMU (docker run --platform linux/riscv64 riscv64/ubuntu:24.04). Tests passed.