You may have heard the story of Ariane 5 rocket which famously exploded on its first flight
due to software bug sometimes called the most expensive software bug in history.
Do you know why the Ariane 5 exploded?
It exploded simply because it had a bug in a 64-bit integer to 16-bit integer conversion.
The interesting thing though is that normally
the code actually did have plenty of checks to track such illegal conversion.
These checks were disabled in the Ariane 5 for reasons of performance.
Picture what would have happened if the computer in the Ariane 5
had been just so slightly be more performant to cover this particular check of a 64-bit
to a 16-bit integer then the assertion would have triggered even during the launch,
but the Ariane 5 actually does have a very good recovery mechanisms for failing assertions.
It would have recovered, may be the flight could have done well
and we would have escaped the most expensive software bug in history.
$317,000,000 went into the sky because of a missing assertion.
Avrai forse sentito la storia del razzo Ariane 5 che notoriamente esplose al primo volo
per via di un bug software, nominato talvolta il piu' costoso bug della storia.
Lo sai perche' Ariane 5 e' esploso?
E' esploso semplicemente perche' aveva un bug nella conversione a intero 64-bit / 16-bit.
Ma la cosa interessante e' che a regola
il codice era in effetti pieno di controlli per trovare questo tipo di conversioni illegali,
ma questi controlli vennero disabilitati sull'Ariane 5 per motivi di prestazioni.
Immagina cosa sarebbe successo se il computer su Ariane 5
fosse stato leggermente piu' performante per eseguire questo paticolare controllo di conversione
64/16 bit: le asserzioni si sarebbero attivate anche durante il lancio,
l'Ariane avrebbe effettivamente avuto un ottimo meccanismo di ripristino da asserzioni bloccanti,
si sarebbe ripreso, forse il volo sarebbe andato liscio
e si sarebbe savato da essere il piu' costoso bug software della storia.
317.000 dollari andati in fumo per via di un'asserzione mancante.
ソフトウェアのバグが原因で
アリアン5は最初の打ち上げで爆発事故を起こしました
これは歴史上最も高くついたバグと
呼ばれることがあります
アリアン5が爆発してしまったのは
64ビットの整数を16ビットへ変換中に
バグがあったからです
このような不正な変換をトラッキングするために
通常はコードが何度もチェックを行っていたのです
アリアン5ではパフォーマンスの問題で
このチェックが無効にされました
アリアン5のコンピュータが
整数の変換をチェックできるくらい性能が高かったら
どういう結果になっていたでしょうか?
打ち上げ中であっても
アサーションがトリガしたはずです
実はアリアン5はアサーションの失敗に対して
優れたリカバリ構造を持っていました
リカバリができていれば打ち上げも成功し
このバグを避けることができたはずです
アサーションがなかったことで
3億1700万ドルが空に消えました
你可能听说过Ariane 5号火箭吧,它在第一次发射时爆炸了,
就是因为软件问题,造成了史上最昂贵的软件bug。
你知道它为什么爆炸吗?
就是因为它在从64位int转到16位int时有bug。
这件有趣(有趣?)的事说明了,尽管
代码确实有多道的检查,可以防止不合法的转换。
但这些检查因为性能的原因,在Ariane 5号上没激活使用。
注意这个后果,如果Ariane 5号上的计算机
牺牲小点性能来进行这个检查,检查64位
到16位的整型转换的话,断言就能在发射过程中触发,
Ariane 5号又有着一个良好的失败断言恢复机制。
那它本来就可以恢复,而这次飞行可能就一切顺利,
我们就能避免史上最昂贵的软件bug了。
就因为缺少一个断言,3.17亿美元就这么打了水漂。