mirror of
https://github.com/apache/nuttx.git
synced 2026-08-18 11:41:51 +08: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:
committed by
Alan C. Assis
parent
5d4f776cdc
commit
059176fe64
+5
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user