-
Notifications
You must be signed in to change notification settings - Fork 215
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
Binary Semaphore locked after thread cancellation #470
Comments
jphickey
added a commit
to jphickey/osal
that referenced
this issue
May 19, 2020
Corrects issue when a task waiting on a binary semaphore is deleted, it left the mutex in a locked state preventing other tasks from using the mutex.
This was referenced May 19, 2020
astrogeco
added a commit
that referenced
this issue
May 26, 2020
Fix #470, Binary sem task delete issues
jphickey
added a commit
to jphickey/osal
that referenced
this issue
Aug 10, 2022
Add required coverage test cases to achieve 100% line coverage in FS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
On POSIX systems using the Binary Semaphore API, there is a risk that threads can become deadlocked after deleting a task that was executing an
OS_BinSemTake()
API call.To Reproduce
OS_BinSemGive()
at some event/interval.OS_BinSemTake()
Then delete task B while it was pending in
OS_BinSemTake()
.The semaphore resource is now inoperable, because the condition mutex was "owned" by task B at the time it was deleted, and is never released, thereby preventing any other task from using the mutex.
Expected behavior
The semaphore should continue to be usable by other tasks after deleting task B.
System observed on:
Ubuntu 20.04
Additional context
This was originally reported/observed in nasa/cFE#701, during shutdown where timers were used.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
(After diagnosis/investigation of issue reported by @excaliburtb in above ticket)
The text was updated successfully, but these errors were encountered: