arch: riscv: stacktrace: user thread stack bound check is wrong #76398
Labels
bug
The issue is a bug, or the PR is fixing a bug
priority: medium
Medium impact/importance bug
Stale
Describe the bug
The calculation of the stack bounds is wrong according to the riscv's
arch.h
:The start of the privilege stack should be:
thread.arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE
Instead of
thread.arch.priv_stack_start - CONFIG_PRIVILEGED_STACK_SIZE
This resulted in empty call trace when the exception happens in a userspace thread.
To Reproduce
Steps to reproduce the behavior:
west build -b qemu_riscv64 -p auto -t run -T zephyr/tests/kernel/mem_protect/userspace/kernel.memory_protection.userspace
test_unimplemented_syscall
doesn't contain call traces:Expected behavior
There should be call traces:
Impact
No call traces in userspace
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: