xiaoxiang781216 commented on code in PR #17043: URL: https://github.com/apache/nuttx/pull/17043#discussion_r2368429362
########## sched/sched/sched_suspendscheduler.c: ########## @@ -68,6 +68,12 @@ void nxsched_suspend_scheduler(FAR struct tcb_s *tcb) return; } +#ifdef CONFIG_TASK_STACK_OVERFLOW_CHECK + /* Check for stack overflow */ + + DEBUGASSERT(!up_check_tcbstack_overflow(tcb)); Review Comment: > Hi, @xiaoxiang781216 I added comments on 17056 ... I don't think 17056 is a better oneļ¼ because: > > 1. I don't think it is a good idea to use `up_check_tcbstack `to do this stack overflow check, `up_check_tcbstack `was designed for checking how many stack has been used, why changing it and with many update to the kernel code that used it? it's naturally extension to specify how many bytes to check. The more important is that we can reuse the same checking code, instead duplicating two version. > > 2. the arch support should be easily added in this PR > but the checking code is duplicated. > > 3, the cases that CONFIG_SCHED_SUSPENDSCHEDULER is not enabled, and the context switch in nxtaxk_exit were not considered > > 4. I didn't find more feature supported .... the patch support more arch and compare sp directly. -- 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