arch: Move the DUMP_ON_EXIT logic after nxtask_exit.

Otherwise we will try to dump the state of the current task, however the
exit handler has already started doing some cleanup and invalidated its
group.  Accessing the group from dumponexit will crash.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche
2022-04-13 13:34:42 +02:00
committed by Xiang Xiao
parent d6c952c56f
commit 6d12ee19e2
15 changed files with 62 additions and 62 deletions
+5 -5
View File
@@ -137,11 +137,6 @@ void up_exit(int status)
sinfo("TCB=%p exiting\n", tcb);
#ifdef CONFIG_DUMP_ON_EXIT
sinfo("Other tasks:\n");
sched_foreach(_up_dumponexit, NULL);
#endif
/* Update scheduler parameters */
nxsched_suspend_scheduler(tcb);
@@ -150,6 +145,11 @@ void up_exit(int status)
(void)nxtask_exit();
#ifdef CONFIG_DUMP_ON_EXIT
sinfo("Other tasks:\n");
sched_foreach(_up_dumponexit, NULL);
#endif
/* Now, perform the context switch to the new ready-to-run task at the
* head of the list.
*/