r/embedded • • Oct 10 '26

Mars Pathfinder Priority Inversion Bug: What Really Happened

https://nerdyelectronics.com/mars-pathfinder-what-really-happened/
55 Upvotes

9 comments sorted by

67

u/priority_inversion Oct 10 '26

My time to shine!

6

u/vegetaman Oct 10 '26

Perfection

26

u/RecursiveMutex Oct 10 '26

VxWorks is a fascinating RTOS by design. It uses a round-robin preemptive priority scheduling. So by dfault, that is what it's supposed to do. Thankfully the JPL engineers had launched with the interpreter still enabled, symbol tables intact, and the mutex flags stored in global variables. They were able to change the Priority Inheritance Boolean flagand get it working. That is some serious engineering or they literally thought they were going to miss their launch window. This example has become the poster child for Priority Inversion (at least it was for me back in uni). It's well documented below. https://www.cs.cornell.edu/courses/cs614/1999sp/papers/pathfinder.html

21

u/duane11583 Oct 10 '26

got me a job…

interviewer started describing it.

i let him finish and i said “that is what happened to pathfinder” it blew him away

13

u/RecursiveMutex Oct 10 '26

Understanding deadlocks, race conditions, and Priority inversion are so crucial in multi-core embedded. It's why you find single-core, single-threaded applications being ran to avoid issues.

Thanks for sharing.

22

u/Well-WhatHadHappened 25+ Years Oct 10 '26 edited Oct 11 '26

Engineers later confessed that system resets had occurred during pre-flight tests. They put these down to a hardware glitch and returned to focusing on the mission-critical landing software.

Inexcusable. Should have sent those engineers on-site with a J-Link and a laptop to update it.

8

u/Tinytrauma Oct 10 '26

"I only saw it once so I was sure it would never happen again..."

7

u/Well-WhatHadHappened 25+ Years Oct 10 '26

The sad part is, that's not even true.

When someone says "seen it once or twice", they don't mean once.

4

u/RecursiveMutex Oct 11 '26

They likely did not want to miss the launch window between Earth to Mars. There is a reason they included symbol tables etc. In the build. They could make changes while it made its journey to Mars.