Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible deadlock of timer callbacks #274

Closed
jphickey opened this issue Oct 23, 2019 · 0 comments · Fixed by #281
Closed

Possible deadlock of timer callbacks #274

jphickey opened this issue Oct 23, 2019 · 0 comments · Fixed by #281
Assignees
Labels
Milestone

Comments

@jphickey
Copy link
Contributor

Describe the bug
If the actual timer interval is larger than the requested timer interval, due to the system tick timer resolution, then it is possible for timers to become deadlocked.

To Reproduce
Configure a timer with OS_TimerCreate() and OS_TimerSet(). Configure the interval such that it must be rounded up to a whole number of system ticks.

The timer works fine for a while, but then callbacks will cease once the first overrun occurs.

Expected behavior
Callbacks should continue until canceled by the application.

System observed on:
RTEMS 4.11 (pc686) running in QEMU
MPC750 VxWorks 6.9

Additional context
Discovered as part of the fix for #271, submitted as a separate bug for review as it affects the shared/common layer.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit that referenced this issue Oct 23, 2019
If the tick_time from the wait routine was perpetually
greater than the interval time, eventually the wait_time
became such that it was always below zero.  Once this
occurs, application callbacks would cease entirely.

To avoid this, run the callback condition in a loop
for periodic timers only (not for one-shot config).
@skliper skliper added the bug label Oct 30, 2019
@skliper skliper added this to the 5.1.0 milestone Oct 30, 2019
skliper pushed a commit that referenced this issue Oct 31, 2019
If the tick_time from the wait routine was perpetually
greater than the interval time, eventually the wait_time
became such that it was always below zero.  Once this
occurs, application callbacks would cease entirely.

To avoid this, run the callback condition in a loop
for periodic timers only (not for one-shot config).
skliper added a commit that referenced this issue Oct 31, 2019
Fixes #271 #272 #273 #274
Code reviewed and approved at 20191030 CCB
skliper added a commit that referenced this issue Nov 7, 2019
Fix #274: Avoid possible deadlock of timer callback
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
No longer keeps a running count of child tasks
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Fix nasa#274, NumOfChildTasks not decremented
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants