海外优秀资讯抢先看9:世界著名软件缺陷灾难性案例详解之爱国者导弹自摆乌龙事件

Patriot Missile Failure

爱国者导弹的挫败

On February 25, 1991, during the Gulf War, an American Patriot Missile battery in Dharan, Saudi Arabia, failed to intercept an incoming Iraqi Scud missile. The Scud struck an American Army barracks and killed 28 soldiers. A report of the General Accounting office, GAO/IMTEC-92-26, entitled Patriot Missile Defense: Software Problem Led to System Failure at Dhahran, Saudi Arabia reported on the cause of the failure. It turns out that the cause was an inaccurate calculation of the time since boot due to computer arithmetic errors. Specifically, the time in tenths of second as measured by the system‘s internal clock was multiplied by 1/10 to produce the time in seconds. This calculation was performed using a 24 bit fixed point register. In particular, the value 1/10, which has a non-terminating binary expansion, was chopped at 24 bits after the radix point. The small chopping error, when multiplied by the large number giving the time in tenths of a second, lead to a significant error. Indeed, the Patriot battery had been up around 100 hours, and an easy calculation shows that the resulting time error due to the magnified chopping error was about 0.34 seconds. (The number 1/10 equals 1/24+1/25+1/28+1/29+1/212+1/213+.... In other words, the binary expansion of 1/10 is 0.0001100110011001100110011001100.... Now the 24 bit register in the Patriot stored instead 0.00011001100110011001100 introducing an error of 0.0000000000000000000000011001100... binary, or about 0.000000095 decimal. Multiplying by the number of tenths of a second in 100 hours gives 0.000000095×100×60×60×10=0.34.) A Scud travels at about 1,676 meters per second, and so travels more than half a kilometer in this time. This was far enough that the incoming Scud was outside the "range gate" that the Patriot tracked. Ironically, the fact that the bad time calculation had been improved in some parts of the code, but not all, contributed to the problem, since it meant that the inaccuracies did not cancel.

在1991年2月25号海湾战争期间,一枚美国的爱国者导弹因为基于内部时钟的时间计算缺陷,不能够在沙特阿拉伯的达兰成功拦截伊拉克发射过来的一枚飞毛腿导弹。该飞毛腿导弹击中了该地的一个美军军营并导致28个士兵阵亡。美国审计总署提供的GAO/IMTEC-92-26号报告文件描述了该拦截失败的原因,其标题为:“爱国者导弹防御:软件缺陷导致防御系统在沙特阿拉伯达兰的拦截失败”。原来原因是因为从系统启动时开始计算的不够精确的时间运算导致的错误。明确的说,就是爱国者导弹防御系统时间的衡量计算是基于系统时钟时间乘以1/10所得到的秒数来进行表示的(天地会珠海分舵注:本人认为可以理解为,一旦你调用一个获取系统时间的API如getTimeInSeconds(),系统自动就会把系统时钟的时间乘以1/10来进行返回,所以爱国者导弹系统的编码人员在获得该系统提供的时间后还需要乘以10才能获得真正的秒数)。且这个自动乘以1/10的运算是使用一个24位的定点寄存器来进行的。因为大家都知道计算机上面的数字都是以二进制来表示的,所以十进制的1/10用二进制来表示的话,学过进制转换的朋友应该会清楚二进制表示的1/10会产生无尽循环(天地会珠海分舵注:因为十进制小数需要用二进制表示的话是通过一到多个2的n次方分之一相加组合而成的,而0.1是没有办法用有限个2的n次方分之1相加而获得的),而24位的寄存器只能存放24位的有效位,其余小数精度部分会被砍掉。但是这个看似微不足道的缺少掉被砍掉的24位之后的精度的数值在乘以一个很大的数值(在这里就是系统启动之后的总秒数乘以1/10的所返回的系统时间)所获得的数字所产生的结果将会有一个巨大的偏差。事实上,当时该爱国者导弹系统的电池已经启动了100个小时,这样下面一个很简单的计算公式就能计算出该砍掉的精度所导致的时间偏差会达到0.34秒之多。(十进制的1/10转换成二进制将会是1/24+1/25+1/28+1/29+1/212+1/213+....的一个无尽循环,换句话说,表示成二进制小数的无尽循环将会是:0.0001100110011001100110011001100....,而现在24位寄存器存放的数字将会是0.00011001100110011001100,这相比真实的大小将会引进来24位之后的用二进制小数表示 0.0000000000000000000000011001100... 的误差,也就相当于10进制的0.000000095的误差。那么把这个数值乘以系统返回来的系统时间再乘以10就是计算得到的当前系统以秒数表示的时间所产生的误差值:0.000000095×100×60×60×10=0.34)一个飞毛腿导弹飞行的速度大概是1,676米每秒,所以在0.34秒的误差时间内针对飞毛腿导弹就会产生超过半公里的误差。这个距离已经足够让正在飞来的飞毛腿导弹跨出爱国者导弹系统进行导弹跟踪的有效"距离门"(天地会珠海分舵注:本人认为如果把它解析成“目标位置”或许会更好的帮助你进行理解)的范围之外了。具有讽刺意味的是,该时间误差导致的问题在代码的某些部分是有进行修复的,也就是代表有人已经意识到这个错误的,但问题是当时并没有把相关的所有问题的代码进行修复,也就是说该时间精度的问题是依然存在该系统之中对该灾难性时间做着“贡献”的。

The following paragraph is excerpted from the GAO report.

以下是对该GOF报告的部分引用:

The range gate‘s prediction of where the Scud will next appear is a function of the Scud‘s known velocity and the time of the last radar detection. Velocity is a real number that can be expressed as a whole number and a decimal (e.g., 3750.2563...miles per hour). Time is kept continuously by the system‘s internal clock in tenths of seconds but is expressed as an integer or whole number (e.g., 32, 33, 34...). The longer the system has been running, the larger the number representing time. To predict where the Scud will next appear, both time and velocity must be expressed as real numbers. Because of the way the Patriot computer performs its calculations and the fact that its registers are only 24 bits long, the conversion of time from an integer to a real number cannot be any more precise than 24 bits. This conversion results in a loss of precision causing a less accurate time calculation. The effect of this inaccuracy on the range gate‘s calculation is directly proportional to the target‘s velocity and the length of the the system has been running. Consequently, performing the conversion after the Patriot has been running continuously for extended periods causes the range gate to shift away from the center of the target, making it less likely that the target, in this case a Scud, will be successfully intercepted.

“距离门”(天地会珠海分舵注:本人认为如果把它解析成“目标位置”或许会更好的帮助你进行理解)预测一个飞毛腿导弹下一次将会在哪里出现是通过一个函数来实现的,该函数接受的是两个参数:飞毛腿导弹的速度和雷达在上一次侦测到该导弹的时间。其中速度可以表示为一个整数和一个小数(比如,3750.2563...英里每小时)。而其中的时间是在爱国者反导弹系统中由内部时钟以总秒数的1/10的方式不停的刷新保存起来的,且该保存形式将会是以整形或者整数的方式呈现出来的(比如,33, 34...)。系统运行时间越长,表示时间的数字就会越大。为了预测一个飞毛腿导弹下一次将会在哪里出现,两个参数速度和时间都必须以实数的方式进行表示。因为爱国者导弹计算机系统本身的计算方法以及时间运算过程中用来存储时间的寄存器的大小只有24位,所以一个时间数字转换成对应的实数后获得的精度将不会再高于24位能表示的范围了。这个转换的结果将会导致精度的丢失。丢失的精度引发的后果在“距离门”对预测飞毛腿导弹下一次出现位置的预测的计算中就可以直接通过被检测的目标(飞毛腿导弹)的飞行速度和系统当前已经运行的时间长度体现出来了。后果就是,在该爱国者导弹系统已经不停的运行很长一段时间之后对时间进行转换将会导致“距离门”相对飞毛腿导弹这个目标的真实的中心位置产生偏移,这就让系统对该目标(在这种情况下指的就是飞毛腿导弹)进行拦截成为不大可能实现的事情了。

作者/译者


微信公众号


CSDN


天地会珠海分舵


服务号:TechGoGoGo

扫描码:


http://blog.csdn.net/zhubaitian

时间: 2024-07-30 00:18:52

海外优秀资讯抢先看9:世界著名软件缺陷灾难性案例详解之爱国者导弹自摆乌龙事件的相关文章

海外优秀资讯抢先看10:世界著名软件缺陷导致的灾难性案例详解之阿丽安娜火箭之殇

Explosion of the Ariane 5 阿丽安娜5运载火箭爆炸之谜 On June 4, 1996 an unmanned Ariane 5 rocket launched by the European Space Agency exploded just forty seconds after lift-off (918K QuickTime movie). The rocket was on its first voyage, after a decade of develop

海外优秀资讯抢先看12:世界上最薄的硅材料将为您带来引爆眼球的更快,更小,更高效的计算机芯片

One-atom-thin 'silicene' silicon transistors invented 原子大小数量级的硅烯晶体管宣告诞生 World's thinnest silicon material promises dramatically faster, smaller, more efficient computer chips 世界上最薄的硅材料将有望带来引人注目的更快,更小,更高效的计算机芯片 February 5, 2015 2015年2月5号 The first tra

海外优秀资讯抢先看8 - Windows 10 for Raspberry Pi 2

Windows 10 for Raspberry Pi 2 树莓派2代上的Windows 10 We're excited to announce that we are expanding our Windows Developer Program for IoT by delivering a version of Windows 10 that supports Raspberry Pi 2. This release of Windows 10 will be free for the

海外优秀资讯抢先看7:私有应用云平台Sandstorm服务对象之企业

Use Sandstorm to run your enterprise server cluster: 使用Sandstorm来运行你的企业服务器集群 Easy App Deployment 简易部署 A Sandstorm app only takes a couple clicks to deploy. It's so easy and secure that non-technical employees can actually deploy the apps they need th

第一章 虚拟化与云计算 (纯属自己看VMware Citrix和Microsoft虚拟化技术详解与应用实践的学习笔记)

第一章      虚拟化与云计算 1.虚拟化的定义 虚拟化是一个广义的术语,各行各业对虚拟化的理解均不同,不同的人对虚拟化的理解也不同,所以它没有一个标准的定义. a          虚拟化是以某种用户和应用程序都可以很容易从中或以的方式来表示计算机资源的过程,而不是根据这些资源的实现.地理位置或物理包装的专有方式来表示它们.换句话说,它为数据.计算能力.存储资源以及其他资源提供了一个逻辑视图,而不是物理视图. b          虚拟化是表示计算机资源的逻辑组(或子集)的过程,这样就可以用

世界时区和Java时区详解

0.引言 Druid中时区的问题一直困扰着我们,所以我专门去研究了一下世界时区和Java中的时区,对使用Druid很用帮助. 1.UTC时间&GMT时间 UTC时间是时间标准时间(Universal Time Coordinated),UTC是根据原子钟来计算时间,误差非常小. UTC也是指零时区的时间,如果要表示其他时区的时间,这里要注意没有UTC+0800或者UTC+8这样的表示方式(至少Java里面没有,一般用于口头表示),只有Asia/Shanghai这样的表示方式,详细的时区列表参考这

一张图让你看懂JVM之垃圾回收算法详解

前言 从上面这个图我们总体上对JVM的结构特别是内存结构有了比较清晰的认识,虽然在JDK1.8+的版本中,JVM内存管理结构有了一定的优化调整.主要是方法区(持久代)取消变成了直接使用元数据区(直接内存)的方式,但是整体上JVM的结构并没有大改,特别是我们最为关心的堆内存管理方式并没有在JDK1.8+的版本中有什么变化,所以图中的结构整体上是没有什么不准确的,之所以将方法区以及持久代标注出来,主要还是为了起到对比认识的作用,大家知道就可以了. 关于持久代元数据区的使用问题,目前可以理解就是使用的

世界著名景点惊艳反面 稍远一点看竟平庸至极

很多情况下,看风景的角度不同,往往会看到大不相同的风景.比如,很多人都习惯了的著名建筑古迹和世界奇观的样貌,也许换一个角度,便会得到不一样的惊喜. 俄罗斯"大图网"发布一组图片,从近景和远景两个角度展示同一名胜的风貌.世界著名景点那些惊艳的照片背后.[详情] http://www.zhihu.com/collection/54013585http://www.zhihu.com/collection/54013589http://www.zhihu.com/collection/540

海外优秀资源清单,建议中高级人材收藏

本来我在7月18号的时候就已经在Medium的热点推荐中看到这篇文章的了,但是当时觉得这种文章就是哗众取宠,在Medium上应该也是昙花一现而已,所以没有仔细去查看.但是昨天上Medium时一看,发现这篇文章竟然还在热点推荐栏目! 通常,在Medium这个世界著名的媒体上面,每天都有高质量的好文章出来,所以热点文章是经常易主的.而一篇文章能雄踞榜单一周,甚至两周以上是极其罕见的.所以我就开始对这篇文章的推荐进行验证,发现文章中推荐的各大网站确实名不虚传. 随着网络的快速发展,我们现在获取知识的资