mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
sched: avoid dumping raw memory at address 0 for tasks without kstack
dump_stacks() only checked kernelstack_sp != 0 || force, so for tasks with no kernel stack (e.g. idle, kernelstack_base == 0) the force path passed base 0 to dump_stackinfo() and dumped raw memory from address 0, triggering a secondary fault that truncated the panic log. Guard with kernelstack_base != 0. Signed-off-by: liang.huang <liang.huang@houmo.ai>
This commit is contained in:
parent
522ae4cb3f
commit
413f061d8f
1 changed files with 5 additions and 1 deletions
|
|
@ -325,7 +325,11 @@ static void dump_stacks(FAR struct tcb_s *rtcb, uintptr_t sp)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||
if (kernelstack_sp != 0 || force)
|
||||
/* kernelstack_base is NULL for tasks with no kernel stack (e.g. idle).
|
||||
* dump_stackinfo() would then dump raw memory starting at address 0.
|
||||
*/
|
||||
|
||||
if (kernelstack_base != 0 && (kernelstack_sp != 0 || force))
|
||||
{
|
||||
dump_stackinfo("Kernel",
|
||||
kernelstack_sp,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue