Skip to content

Occasional deadlock issue in tests that delete tasks #1027

@jphickey

Description

@jphickey

Describe the bug
When running the unit tests repeatedly, occasionally some tests are getting into a deadlock. These tests are ones that:

  1. use sub-tasks to do various work
  2. those sub-tasks use OS_printf()
  3. 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions