4 ms·
I'd really love more details about this. What did the surrounding code look like, why wasn't there a compiler warning being produced by this code etc. There's
by XorNot 14y ago
I'd really love more details about this. What did the surrounding code look like, why wasn't there a compiler warning being produced by this code etc.
There's certainly a much larger - and probably quite informative - story here.
- lmm 14y agoIt was ADA, there was a trap that would have caught it but had been disabled (I believe for performance?) AIUI the decision to disable it had been made when it was Ariane IV code (and if an Ariane IV had ever been travelling that fast then it would have already been lost) - and then never reevaluated when the code was reused for Ariane V.
- david_p 14y agoA friend of mine did a presentation about this. What he told me is that apparently, the developpers who wrote and tested the code that overflowed were designing for a value in miles. When stored in miles, the value would never got outside the range of a 16 bit unsigned int, but the actual value used was in kilometers, and when converted to kilometers, the value would overflow.
- marco-fiset 14y agoIf a simple multiplication by 1.60934 (miles to kilometers) can create an overflow, than you are not using a big enough data type. I can't believe that's the real reason.
- david_p 14y agoApparently I mixed up the story with Mars Climate Orbiter ... More details about the Ariane 5 failure here: http://people.cs.clemson.edu/~steve/Spiro/arianesiam.htm http://people.cs.clemson.edu/~steve/Spiro/arianesiam.htm
- Tloewald 14y agoThis seems unlikely for a European/French system. Are you perhaps confusing this story with the NASA Mars Observer mission, mentioned elsewhere in the thread, which failed because of a metric vs imperial error? The value was horizontal velocity. I imagine in metric it would be expressed in m/s while in imperial it's going to be feet per second (mph seems highly improbable).
- ctdonath 14y agoThe Mars Climate Orbiter mixed up feet with meters. Seems it calculated how far off the surface it was during landing, and when it decided it was at 0 units above the surface the retro-rockets were shut off as intended. Except that it was, in fact, still a few miles up. Code re-use struck again.
- wazoox 14y agoIndeed there are code samples on the WP page: https://en.wikipedia.org/wiki/Cluster_%28spacecraft%29 https://en.wikipedia.org/wiki/Cluster_%28spacecraft%29
- deleted 14y ago[deleted]
- ctdonath 14y agoI've told the story to my students many times (probably mangling some minor details over the years, but getting the point across). AFAIK (correct me if wrong)... - The code was re-used from the Ariane 4, which was designed for launch only in the northern hemisphere. The Ariane 5 was launched from south of the equator, hence the importance of unsigned vs signed. - A run-time warning was generated. Problem was where to put the warning, which wasn't specified, and which thru dangling pointer overwrote current position/velocity data. Watchdog code noticed the now-impossible trajectory, decided the system was very very confused, and initiated self-destruct for (relative) safety.
- InclinedPlane 14y agoBoth Ariane 4 and Ariane 5 launch from the same facility (in Kourou, Guyana, almost right on the equator (5.2 deg. N latitude)). The specific problem was that the Ariane 5 had more horizontal motion than the Ariane 4. Within the code there was a conversion of a 64-bit float to a 16-bit signed integer, which overflowed on the Ariane 5 flight causing the inertial measurement unit to start spewing out diagnostic information which the flight control software merrily interpreted as data and drove the vehicle off course.
- HeyLaughingBoy 14y agoNitpick. Kourou is in French Guiana (Cayenne), not Guyana. They are different countries. Similarity in name is due because three neighboring colonies used to be called "the Guianas." French, British and Dutch. British Guiana became independent in 1966 and changed its name to Guyana. Minor, and rather pedantic, detail, but seeing the place you were born being constantly mischaracterized is a bit irritating after a while :-)