[Bug 2152] New: Race condition with unified work areas

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Thu Nov 21 09:41:34 UTC 2013


             Bug #: 2152
           Summary: Race condition with unified work areas
    Classification: Unclassified
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: sebastian.huber at embedded-brains.de

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.

Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the bugs mailing list