RTEMS | cpukit: fix off-chain state checks and pointer clearing (!1067)

Gedare Bloom (@gedare) gitlab at rtems.org
Fri Feb 27 20:33:47 UTC 2026




Gedare Bloom commented on a discussion on cpukit/score/src/threadqflush.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1067#note_143756

 >        Scheduler_Node *scheduler_node;
 >  
 >        scheduler_node = _Thread_Scheduler_get_home_node( first );
 > +      _Chain_Initialize_node( &scheduler_node->Wait.Priority.Node.Node.Chain );

Ok, I wonder if we should consider alternatives:
* In `_RBTree_Set_off_tree()`, explicitly NULL the `RTEMS_RB_LEFT()` and `RTEMS_RB_RIGHT()`. This is actually not quite sufficient, since there could still be non-NULL in `RTEMS_RB_LEFT()` without `RTEMS_DEBUG` enabled, which would cause a check of off-chain to fail.
* Add the explicit NULL in `_Priority_Plain_extract`, or even call `_Chain_Set_off_chain()` there.

That would solve the problem at its root cause instead of at the point of use.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1067#note_143756
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260227/1fc0a5e6/attachment.htm>


More information about the bugs mailing list