[Bug 1814] New: SMP race condition between stack free and dispatch

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Jun 14 08:35:49 UTC 2011


https://www.rtems.org/bugzilla/show_bug.cgi?id=1814

           Summary: SMP race condition between stack free and dispatch
           Product: RTEMS
           Version: HEAD
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: cpukit
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: marta.rybczynska at kalray.eu
                CC: frederic.brault at kalray.eu, fournel.nicolas at gmail.com
        Depends on: 1731


Created an attachment (id=1201)
 --> (https://www.rtems.org/bugzilla/attachment.cgi?id=1201)
Thread exit/stack deallocation patch

The thread stack is free'd in _Thread_Close. Then it still uses this stack
before being de-scheduled in _Thread_Dispatch. However, the allocation is
protected by allocator lock, not by the dispatch lock, so in SMP another
processor may grab the already-used-but-freed stack.

The attached patch delays the stack deallocation to Thread_Dispatch. It is done
if the thread we switched from has been removed.

This version depends on #1731, but we can easily provide a separate one.

-- 
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