[Bug 2130] New: Race condition in nanosleep()

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Mon Jul 22 13:01:39 UTC 2013


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

             Bug #: 2130
           Summary: Race condition in nanosleep()
    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


int nanosleep(
  const struct timespec  *rqtp,
  struct timespec        *rmtp
)
{
[...]
  /*
   *  Block for the desired amount of time
   */
  _Thread_Disable_dispatch();
    executing = _Thread_Executing;
    _Thread_Set_state(
      executing,
      STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL
    );

    <-- A signal at this point will destroy the watchdog chain and the system
is corrupt.

    _Watchdog_Initialize(
      &executing->Timer,
      _Thread_Delay_ended,
      executing->Object.id,
      NULL
    );
    _Watchdog_Insert_ticks( &executing->Timer, ticks );
  _Thread_Enable_dispatch();
[...]

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