mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
arch/risc-v: dump backtrace when killing a task with SIGSEGV
When riscv_fault_handler() kills a user task with SIGSEGV, it previously produced no stack trace, making the crash hard to diagnose. Call sched_dumpstack() on the killed task when SCHED_BACKTRACE is enabled. Assisted-by: Claude Code:claude-sonnet-5 Signed-off-by: liang.huang <liang.huang@houmo.ai>
This commit is contained in:
parent
7c75dbae2b
commit
ed368470d1
1 changed files with 4 additions and 0 deletions
|
|
@ -119,6 +119,10 @@ static void riscv_fault_handler(uintreg_t cause, void *regs)
|
|||
_alert("Segmentation fault in %s (PID %d: %s)\n", get_task_name(ptcb),
|
||||
tcb->pid, get_task_name(tcb));
|
||||
|
||||
#ifdef CONFIG_SCHED_BACKTRACE
|
||||
sched_dumpstack(tcb->pid);
|
||||
#endif
|
||||
|
||||
tcb->flags |= TCB_FLAG_FORCED_CANCEL;
|
||||
|
||||
/* Return to _exit function in privileged mode with argument SIGSEGV */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue