-
Notifications
You must be signed in to change notification settings - Fork 245
Description
Describe the bug
When running the unit tests repeatedly, occasionally some tests are getting into a deadlock. These tests are ones that:
- use sub-tasks to do various work
- those sub-tasks use OS_printf()
- use an asynchronous OS_TaskDelete during their cleanup/teardown
In the event that the sub-task was in the midst of an OS_printf() call when OS_TaskDelete was invoked, the underlying BSP lock will not get released.
Observed in mutex-test, but others may have similar patterns.
To Reproduce
Run mutex-test repeatedly, may deadlock at some runs. (it is a race condition, not 100% reproducible)
Expected behavior
Should run consistently.
System observed on:
Ubuntu
Additional context
This really just a symptom of a generic/known issue with OS_TaskDelete, in that other resources held by that task are not necessarily tracked or freed, depending on what it was doing at the time it was deleted.
Linux/Pthreads does have a workaround but the issue is likely to exist on all OS's
Reporter Info
Joseph Hickey, Vantage Systems, Inc.