xiaoxiang781216 commented on code in PR #10858: URL: https://github.com/apache/nuttx/pull/10858#discussion_r1346222975
########## sched/misc/assert.c: ########## @@ -554,12 +554,22 @@ static void dump_deadlock(void) void _assert(FAR const char *filename, int linenum, FAR const char *msg, FAR void *regs) { - FAR struct tcb_s *rtcb = running_task(); + FAR struct tcb_s *rtcb = current_task(); +#ifdef CONFIG_BUILD_KERNEL Review Comment: why not print in other mode too? ########## sched/misc/assert.c: ########## @@ -554,12 +554,22 @@ static void dump_deadlock(void) void _assert(FAR const char *filename, int linenum, FAR const char *msg, FAR void *regs) { - FAR struct tcb_s *rtcb = running_task(); + FAR struct tcb_s *rtcb = current_task(); Review Comment: the panic may happen in the interrupt handler, in this case current_task point to the new high priority task which may different from the interrupted task(running_task). running_task is always same as current_task in the thread context, but running_task point to the interrupted task during interrupt handling, utils the interrupt process finish. At that point, running_task will sync with current_task again. So, running_task always point to the running task, but ccurrent_task may point to the task which will run after finishing the inerrupt process. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org