You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "jerpelea (via GitHub)" <gi...@apache.org> on 2026/09/07 08:23:56 UTC
[PR] {bp-19972} sched/sporadic: fix policy switch and cross-task setparam [nuttx]
jerpelea opened a new pull request, #20074:
URL: https://github.com/apache/nuttx/pull/20074
## Summary
This PR fixes two bugs in the SCHED_SPORADIC handling of the scheduler, both found while testing sporadic policy switching:
sched_setscheduler(): The policy flag bits were cleared before the switch (policy) statement. Since TCB_FLAG_SCHED_FIFO is 0, the checks for "was the task previously SCHED_SPORADIC" inside the SCHED_FIFO/SCHED_RR cases could never be true. As a result nxsched_stop_sporadic() was never called when a sporadic task switched to another policy, leaking the sporadic state and its replenishment timers; a sporadic-to-sporadic reconfiguration ran nxsched_initialize_sporadic() instead of reset, leaking the old state. The flags are now cleared only after the previous policy has been evaluated.
sched_setparam(): set_sporadic_param() tested rtcb (the calling task) instead of tcb (the task being modified). A cross-task sched_setparam() therefore never updated the target's sporadic parameters, and if the caller was itself sporadic while the target was not, it would reset a task with no sporadic state (NULL-pointer / assertion failure) and write parameters into the caller's own sporadic state.
## Impact
RELEASE
## Testing
CI
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] {bp-19972} sched/sporadic: fix policy switch and cross-task setparam [nuttx]
Posted by "jerpelea (via GitHub)" <gi...@apache.org>.
jerpelea commented on PR #20074:
URL: https://github.com/apache/nuttx/pull/20074#issuecomment-5569326706
CI fix
https://github.com/apache/nuttx-apps/pull/3775
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] {bp-19972} sched/sporadic: fix policy switch and cross-task setparam [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #20074:
URL: https://github.com/apache/nuttx/pull/20074
--
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-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org