The Mars Pathfinder mission was widely proclaimed as "flawless" in the early days after its July 4th, 1997 landing on the
Martian surface. Successes included its unconventional "landing" bouncing
onto the Martian surface surrounded by
airbags, deploying the Sojourner rover, and gathering and transmitting voluminous data back to Earth, including the
panoramic pictures that were such a hit on the Web. But a few days into the mission, not long after Pathfinder started
gathering meteorological data, the spacecraft began experiencing total system resets, each resulting in losses of data. The
press reported these failures in terms such as "software glitches" and "the computer was trying to do too many things at
once".
This week at the IEEE RealTime
Systems Symposium I heard a fascinating keynote address by David Wilner, Chief
Technical Officer of Wind River Systems. Wind River makes VxWorks, the realtime
embedded systems kernel that was
used in the Mars Pathfinder mission. In his talk, he explained in detail the actual software problems that caused the total
system resets of the Pathfinder spacecraft, how they were diagnosed, and how they were solved. I wanted to share his story
with each of you.
VxWorks provides preemptive priority scheduling of threads. Tasks on the Pathfinder spacecraft were executed as threads
with priorities that were assigned in the usual manner reflecting the relative urgency of these tasks.
Pathfinder contained an "information bus", which you can think of as a shared memory area used for passing information
between different components of the spacecraft. A bus management task ran frequently with high priority to move certain
kinds of data in and out of the information bus. Access to the bus was synchronized with mutual exclusion locks
(mutexes).
The meteorological data gathering task ran as an infrequent, low priority thread, and used the information bus to publish
its data. When publishing its data, it would acquire a mutex, do writes to the bus, and release the mutex. If an interrupt
caused the information bus thread to be scheduled while this mutex was held, and if the information bus thread then
attempted to acquire this same mutex in order to retrieve published data, this would cause it to block on the mutex,
waiting until the meteorological thread released the mutex before it could continue. The spacecraft also contained a
communications task that ran with medium priority.
Most of the time this combination worked fine. However, very infrequently it was possible for an interrupt to occur that
caused the (medium priority) communications task to be scheduled during the short interval while the (high priority)
information bus thread was blocked waiting for the (low priority) meteorological data thread. In this case, the longrunning
communications task, having higher priority than the meteorological task, would prevent it from running,
consequently preventing the blocked information bus task from running. After some time had passed, a watchdog timer
would go off, notice that the data bus task had not been executed for some time, conclude that something had gone
drastically wrong, and initiate a total system reset.
This scenario is a classic case of priority inversion.
HOW WAS THIS DEBUGGED?
VxWorks can be run in a mode where it records a total trace of all interesting system events, including context switches,
uses of synchronization objects, and interrupts. After the failure, JPL engineers spent hours and hours running the system
on the exact spacecraft replica in their lab with tracing turned on, attempting to replicate the precise conditions under
which they believed that the reset occurred. Early in the morning, after all but one engineer had gone home, the engineer
finally reproduced a system reset on the replica. Analysis of the trace revealed the priority inversion.
ดาวอังคารภารกิจคือผู้นำทางอย่างกว้างขวางประกาศ " ไร้ที่ติ " ในวันแรก หลังที่ 4 กรกฎาคม 2540 ลงจอดบนพื้นผิวดาวอังคาร
. ความสำเร็จของ " เชื่อมโยงไปถึง " แหกคอกรวมแสงไปยังพื้นผิวดาวอังคารด้วย
ใช้คนต่างด้าวถุงลมนิรภัย , แลนด์โรเวอร์ และรวบรวม และส่งข้อมูลกลับมายังโลกมากมาย รวมทั้ง
มองเห็นภาพที่ดังในเว็บ แต่ไม่กี่วันในภารกิจ ไม่นานหลังจากเริ่มเบิก
รวบรวมข้อมูลทางอุตุนิยมวิทยา ยานอวกาศเริ่มประสบการตั้งค่าของระบบทั้งหมด แต่ละผลในการสูญเสียของข้อมูล
กดรายงานเหล่านี้ล้มเหลวในเรื่องเช่น " บกพร่อง " ซอฟต์แวร์และคอมพิวเตอร์ที่พยายามทำหลายสิ่งที่ครั้งนึง
"ในสัปดาห์นี้ในการประชุมระบบเรียลไทม์
IEEE ผมได้ยินที่น่าสนใจงานที่อยู่โดย เดวิด วิลเนอร์ หัวหน้าเจ้าหน้าที่เทคนิคของ
ลมแม่น้ำระบบ . ลมแม่น้ำทำให้ vxworks , เรียลไทม์ระบบเคอร์เนลที่ถูก
ใช้ในภารกิจดาวอังคารพาธไฟน์เดอร์แบบฝังตัว ในคำพูดของเขา เขาอธิบายในรายละเอียดซอฟแวร์ที่เกิดขึ้นจริง ปัญหาที่ทำให้ระบบทั้งหมด
รีเซ็ตของผู้นำทางในยานอวกาศวิธีที่พวกเขาได้รับการวินิจฉัย และวิธีที่พวกเขาได้รับการแก้ไข ฉันต้องการที่จะแบ่งปันเรื่องราวของเขา
vxworks กับแต่ละท่าน ให้ความสำคัญการเกิดของหัวข้อ งานบนยานอวกาศ Pathfinder ถูกประหารอย่างกระทู้
มีความสําคัญที่ได้รับมอบหมายในลักษณะปกติสะท้อนให้เห็นถึงความเร่งด่วน ญาติของงานเหล่านี้
เบิกที่มีอยู่ " ข้อมูลรถบัส "ที่คุณสามารถคิดเป็นหน่วยความจำที่ใช้ร่วมกันพื้นที่ใช้สำหรับส่งผ่านข้อมูลระหว่างชิ้นส่วนที่แตกต่างกัน
ของยานอวกาศ งานการจัดการรถโดยสารวิ่งบ่อยมีลำดับความสำคัญสูงที่จะย้ายบางชนิดของข้อมูล
และออกจากรถบัสข้อมูล การเข้าถึงรถบัสตรงกับล็อคการยกเว้นร่วมกัน
( mutexes ) ข้อมูลอุตุนิยมวิทยา รวบรวมงานวิ่งเป็นไม่บ่อยนัก ,หัวข้อความสำคัญน้อย และใช้รถบัสข้อมูลเผยแพร่
ของข้อมูลของ เมื่อเผยแพร่ข้อมูลก็จะได้รับ mutex ทำ เขียน รถบัส และปล่อย mutex . หากมีรบกวน
เกิดจากข้อมูลรถเมล์ด้ายจะกำหนดในขณะที่ mutex นี้ถูกจัดขึ้น และหากข้อมูลรถเมล์ด้ายแล้ว
พยายามที่จะได้รับ mutex เดียวกันนี้ในการดึง เผยแพร่ข้อมูลนี้จะทำให้บล็อกบน mutex
, รอจนกว่ากระทู้อุตุนิยมวิทยาออก mutex ก่อนที่จะสามารถต่อ ยานอวกาศยังมีการสื่อสารที่งานวิ่งด้วย
ความสำคัญปานกลาง เวลาส่วนใหญ่ของชุดนี้ทำงานดี แต่ไม่บ่อยมาก มันเป็นไปได้สำหรับการขัดจังหวะเกิดขึ้นที่
ทำให้ ( ระดับกลาง ) การสื่อสารงานจะกำหนดในช่วงเวลาสั้น ๆในขณะที่ ( สำคัญมาก )
กระทู้รถบัสข้อมูลถูกบล็อกรอ ( สุมาตรา ) หัวข้อข้อมูลทางอุตุนิยมวิทยา ในกรณีนี้ longrunning
งานสื่อสาร มีลำดับความสำคัญสูงกว่างานอุตุนิยมวิทยา จะป้องกันไม่ให้มันจาก
วิ่งดังนั้นการป้องกันบล็อกข้อมูลเมล์งานจากการทํางาน หลังจากเวลาผ่านไป , เตือนภัย
จะปิดไป สังเกตว่าข้อมูลรถบัสงานได้ดำเนินการมานานแล้ว สรุปว่าสิ่งที่ได้ไป
อย่างมากผิด และเริ่มต้นการตั้งค่าของระบบทั้งหมด
สถานการณ์นี้เป็นกรณีคลาสสิกของการผกผันสําคัญ .
แล้วนี้ดีบั๊ก ?
vxworks สามารถวิ่งในโหมดที่บันทึกร่องรอยทั้งหมดที่น่าสนใจเหตุการณ์ของระบบ รวมถึงสวิทช์บริบท
ใช้วัตถุประสาน และขัดจังหวะขึ้นมา หลังจากความล้มเหลว , วิศวกรเจพีใช้เวลาชั่วโมงและชั่วโมงทำงานระบบ
บนแบบจำลองยานอวกาศที่แน่นอนในแล็บของพวกเขาด้วยการเปิด พยายามที่จะทำซ้ำเงื่อนไขที่ชัดเจนภายใต้
ซึ่งพวกเขาเชื่อว่าใหม่เกิดขึ้น ในตอนเช้า หลังจากทั้งหมด แต่หนึ่งในวิศวกรกลับบ้านหมดแล้ว วิศวกร
ในที่สุด ทำซ้ำ การตั้งค่าระบบในแบบจําลอง การวิเคราะห์ติดตาม เปิดเผยความลับ .
การแปล กรุณารอสักครู่..
