sched/event: Fix uninitialized need_switch flag issue in event_post()#17272
Conversation
The `need_switch` flag was not initialized in `event_post()`. Since it is
a local variable, it could contain a random non-zero value, leading to
incorrect behavior.
In addition, this patch also fixes an issue where the event clearing
operation in `event_post()` was not performed correctly.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
09ffd28 to
97b5dec
Compare
699fe29 to
e307dc3
Compare
e307dc3 to
faa8c5c
Compare
|
Thanks @wangchdo :-) No worries, things like this happen, good that you found them quickly and proposed a fix :-) This is very important to give more focus to breaking changes, mark breaking changes, and ask for better testing from the community :-)
CI failed, restarted :-) |
Hi @cederom I’ve uploaded the text logs. Besides, I suspect the CI failure might be related to that I updated the pcduino-a10 board’s defconfig to include CONFIG_SCHED_EVENTS=y.
I enabled this CONFIG_SCHED_EVENTS option because I wanted the CI to run tests for the sched/event module in a real board, and the pcduino-a10 board is included in the CI test set. Do you know how I can fix this CI failure issue? I think maybe the CI does not allow changing defconfig directly... |
|
I mean use Like this: |
faa8c5c to
cd5ccc7
Compare
Enable the event module on pcduino-a10 and smartl-c906 boards to allow event tests to be executed on both ARM and RISC-V architectures. Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
cd5ccc7 to
d89827a
Compare
Hi @cederom |
|
Yes thank you @wangchdo this is it :-) You can mark something like that: |
|
I think I’ve fixed the CI issue. The problem was caused by my previous manual update of the defconfig. This time, I used make menuconfig to enable EVENT, then ran make savedefconfig, and uploaded the updated defconfg file — it’s working fine now. |
|
I fixed CI issue, please help to check again @acassis @anchao @jerpelea @xiaoxiang781216 |

Summary
The root cause of this issue is that during the restructuring of the commit log for #17244 based on @jerpelea’s feedback, I inadvertently used an outdated implementation of event_post from my local history and failed to re-run the tests afterward.
I’ll take this as a valuable lesson — from now on, whenever I amend a commit, I’ll make sure to re-run the tests to ensure no new issues are introduced.
Impact
Fix an issue in the event_post implementation. This change has no impact on other NuttX functions.
Testing
ostest including event tests passed on board a2g-tc397-5v-tft:
ostest including event tests passed on board fvp-armv8r-aarch32: