pussuw commented on code in PR #6197: URL: https://github.com/apache/incubator-nuttx/pull/6197#discussion_r878676300
########## sched/task/exit.c: ########## @@ -70,7 +68,7 @@ void _exit(int status) * ****************************************************************************/ -void exit(int status) +void nx_exit(int status) Review Comment: Calling _exit() directly causes a full system crash. The problem with _exit() is that it removes the current task from the ready-to-run list, and any call to this_task() after that crashes as it does not point to the task that is in execution. File cleanup uses a semaphore for instance and there we have a test for this_task() != idle task, which fails because the running task is not what this_task() returns. If you look at the the old implementation of exit() in kernel side does file stream clean up FIRST, and then calls _exit(), this works because the rtr list head still points to the correct task. -- 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