#2152 closed defect (fixed)

Race condition with unified work areas

Reported by: Sebastian Huber Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: score Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:


With unified work areas enabled the RTEMS workspace and the C program heap are the same. The workspace is protected by disable thread dispatching. The C program heap is protected by the allocator mutex.

Now suppose we are inside a C program heap allocation. Now an interrupt happens which activates a higher priority thread. This thread can run immediately since thread dispatching is allowed. Now this thread performs a workspace allocation which is possible since the workspace is not protected by the allocator mutex. Now two threads access the heap at the same time and corruption may occur.

To be safe in case of unified work areas enabled the C program heap must disable thread dispatching. This has a very negative influence on the worst-case thread dispatch latency which now depends on the heap fragmentation.

Change History (2)

comment:2 Changed on Nov 24, 2014 at 6:58:28 PM by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

Note: See TracTickets for help on using tickets.