pussuw opened a new issue, #14699: URL: https://github.com/apache/nuttx/issues/14699
### Description / Steps to reproduce the issue The round robin scheduling logic causes crashes via: https://github.com/apache/nuttx/blob/db31e569579c7ec9753d5fb69d07e8f997c7eae1/sched/sched/sched_removereadytorun.c#L287-L294 The crash occurs when the task being pre-empted is running on a different CPU / core. The call tree is as follows: ``` _assert() at assert.c:906 0xa001f690 __assert() at lib_assert.c:38 0xa0005d4a nxsched_remove_readytorun() at sched_removereadytorun.c:291 0xa0027f2c nxsched_reprioritize_rtr() at sched_reprioritizertr.c:67 0xa00214f2 nxsched_process_roundrobin() at sched_roundrobin.c:141 0xa003c800 nxsched_cpu_scheduler() at sched_processtimer.c:77 0xa003c424 nxsched_process_scheduler() at sched_processtimer.c:134 0xa003c424 nxsched_process_timer() at sched_processtimer.c:189 0xa003c424 ``` This happens when the system tick advances. An arbitrary CPU will handle the timer interrupt and advance the system ticker. It will then try to run the round robin scheduling logic **for every CPU**. Pre-empting a task on another CPU will obviously not work directly -> **crash**. What do you think @hujun260 should this be handled by your SMP call logic, or something else ? ### On which OS does this issue occur? [OS: Linux] ### What is the version of your OS? Ubuntu ### NuttX Version master ### Issue Architecture [Arch: all] ### Issue Area [Area: Kernel] ### Verification - [X] I have verified before submitting the report. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
