Skip to content

Conversation

@ycsin
Copy link
Member

@ycsin ycsin commented Jul 18, 2024

Account for the scenario when we are doing esf-based unwinding from a function which doesn't have any callee. In this case the ra is not saved on the stack and the second function from the top of the frame could be missing.

Before

image

After

image

@ycsin ycsin modified the milestones: v3.7.1, v4.0.0, v3.7.0 Jul 18, 2024
@ycsin ycsin added the bug The issue is a bug, or the PR is fixing a bug label Jul 18, 2024
@ycsin ycsin force-pushed the pr/riscv_stacktrace_fix_output_without_ra branch 2 times, most recently from 81a12ab to c4aee2f Compare July 18, 2024 17:31
Account for the scenario when we are doing `esf`-based
unwinding from a function which doesn't have any callee.
In this case the `ra` is not saved on the stack and the
second function from the top of the frame could be missing.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
@ycsin ycsin force-pushed the pr/riscv_stacktrace_fix_output_without_ra branch from c4aee2f to 4392ee4 Compare July 19, 2024 06:32
@aescolar aescolar removed this from the v3.7.0 milestone Jul 26, 2024
@ycsin ycsin added this to the v4.0.0 milestone Jul 29, 2024
@ycsin ycsin marked this pull request as ready for review July 29, 2024 15:55
@ycsin ycsin added the backport v3.7-branch Request backport to the v3.7-branch label Jul 29, 2024
@zephyrbot zephyrbot added the area: RISCV RISCV Architecture (32-bit & 64-bit) label Jul 29, 2024
@ycsin ycsin requested a review from luchnikov August 5, 2024 09:01
@nashif nashif merged commit 9698df9 into zephyrproject-rtos:main Aug 6, 2024
@ycsin ycsin deleted the pr/riscv_stacktrace_fix_output_without_ra branch August 7, 2024 01:08
ycsin added a commit to ycsin/zephyr that referenced this pull request Aug 27, 2024
…ect-rtos#76045

The change of alignment check in zephyrproject-rtos#76045 could be wrong and
isn't unnecessary to fix the stack traces output, undo it for
now.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
nashif pushed a commit that referenced this pull request Sep 2, 2024
The change of alignment check in #76045 could be wrong and
isn't unnecessary to fix the stack traces output, undo it for
now.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: RISCV RISCV Architecture (32-bit & 64-bit) backport v3.7-branch Request backport to the v3.7-branch bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v3.7-branch: arch: riscv: stacktrace: trace is incomplete when unwinding from function without callee

7 participants