Skip to content

Conversation

@Saiiijchan
Copy link
Contributor

One-shot timers that expire after a single tick could immediately transition to a dormant state, despite xTimerCommandSent being pdTRUE. This situation resulted in a potential deadlock due to an infinite loop in the timer activation process.

Issue #, if available:
Fix a potential dead loop issue with One-shot timers that expire after one tick. If such a timer expires immediately, its state becomes dormant while xTimerCommandSent remains pdTRUE, causing a dead loop.

Description of changes:
This commit adds a check to ensure the timer callback count (uxTimerCallbacked) is zero before proceeding, preventing the dead loop.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

wangfei_chen and others added 2 commits February 21, 2025 15:27
One-shot timers that expire after a single tick could immediately
transition to a dormant state, despite xTimerCommandSent being pdTRUE.
This situation resulted in a potential deadlock due to an infinite
loop in the timer activation process.

Signed-off-by: wangfei_chen <wangfei_chen@realsil.com.cn>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
@kar-rahul-aws kar-rahul-aws merged commit 4930934 into FreeRTOS:main Feb 24, 2025
@kar-rahul-aws kar-rahul-aws changed the title timer: prevent infinate loop on one-shot timer start timer: prevent infinite loop on one-shot timer start Feb 24, 2025
@Saiiijchan Saiiijchan deleted the refine_timer_settime branch February 26, 2025 01:02
@kuopinghsu
Copy link

missing ; in FreeRTOS_POSIX_timer.c line 279

@Saiiijchan Saiiijchan mentioned this pull request Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants