This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 3c6cb0b76e69595d0e2336923be3967425568aa5
Author: ligd <[email protected]>
AuthorDate: Thu Jul 24 23:54:41 2025 +0800

    sched: add dump_stack() for dumponexit
    
    Add stack dump functionality when tasks exit, which helps with
    debugging and understanding task termination conditions.
    
    
    Signed-off-by: ligd <[email protected]>
---
 sched/sched/sched_dumponexit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sched/sched/sched_dumponexit.c b/sched/sched/sched_dumponexit.c
index d8c6ffe256e..6ecc38c1578 100644
--- a/sched/sched/sched_dumponexit.c
+++ b/sched/sched/sched_dumponexit.c
@@ -27,6 +27,7 @@
 #include <nuttx/config.h>
 
 #include <syslog.h>
+#include <execinfo.h>
 
 #include "sched/sched.h"
 
@@ -61,6 +62,8 @@ void nxsched_dumponexit(void)
          "entry:%p pid: %d, stack_alloc_ptr: %p, adj_stack_size: %zu\n",
          tcb, name, tcb->pid, tcb->sched_priority, tcb->entry.main,
          tcb->group->tg_pid, tcb->stack_base_ptr, tcb->adj_stack_size);
+
+  dump_stack();
 }
 
 #endif /* CONFIG_SCHED_DUMP_ON_EXIT */

Reply via email to