← BYTES
Unix IPC·Master·Ref: 15.4.61

Describe the real 1997 Mars Pathfinder priority-inversion incident: what specifically went wrong, and precisely how priority inheritance fixed it.

Have a question about this video? Mention reference 15.4.61 when you contact us.

priority
  HIGH   ----|                    |---------->  (finally runs)
             | BLOCKED on a lock  |
  MEDIUM     |------------------->|  <- keeps preempting LOW meanwhile
             |                    |
  LOW    ----+--------------------+---->
          (holds the lock)   (releases the lock, far too late)

time -------------------------------------------------->

Without priority inheritance: MEDIUM keeps preempting LOW, so LOW
never finishes -- HIGH waits far longer than it should, eventually
tripping a watchdog reset.

With priority inheritance: LOW is temporarily boosted to HIGH's
priority while it holds the lock, so MEDIUM can't preempt it anymore.
LOW finishes quickly, HIGH's wait becomes bounded again.
a.The rover's wheels got physically stuck in Martian sand, an unrelated mechanical issue with no software component
b.The spacecraft's software had no bugs at all, and the resets were caused entirely by cosmic radiation with no connection to any locking primitive
c.A low-priority data-collection task held a mutex protecting a shared information bus; a high-priority bus-management task would periodically need that same mutex and could be blocked waiting for it; occasionally, several OTHER medium-priority tasks would run during that window, preventing the low-priority mutex-holder from ever getting scheduled to finish and release it -- so the high-priority task's wait stretched out far longer than intended, eventually triggering a watchdog timer that assumed something
d.The issue was fixed by physically replacing the rover's CPU with a faster model after it had already landed on Mars
This is a genuine, famous, well-documented real-world instance of exactly the priority-inversion mechanism covered earlier in this topic: a low-priority task holding a mutex could be prevented from finishing (and releasing it) by unrelated medium-priority tasks running in between, stretching a high-priority task's wait for that same mutex unpredictably long enough to trip a watchdog reset -- fixed, famously, by enabling an already-available-but-unused priority-inheritance option in the RTOS's mutex implementation, which is the real-world case study that made this specific failure mode widely known in the field.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES15461#UnixIPC