我又一次在设计评审中遇到了这样的说法,即某个特定场景的概率“小于宇宙射线影响程序的风险”,我突然意识到我根本不知道这个概率是多少。

“既然2-128是340282366920938463463374607431768211456中的1,我认为我们有理由在这里冒险,即使这些计算有几十亿倍的偏差……我相信,宇宙射线把我们搞砸的风险更大。”

这个程序员正确吗? 宇宙射线击中计算机并影响程序执行的概率是多少?


当前回答

Memory errors are real, and ECC memory does help. Correctly implemented ECC memory will correct single bit errors and detect double bit errors (halting the system if such an error is detected.) You can see this from how regularly people complain about what seems to be a software problem that is resolved by running Memtest86 and discovering bad memory. Of course a transient failure caused by a cosmic ray is different to a consistently failing piece of memory, but it is relevant to the broader question of how much you should trust your memory to operate correctly.

基于20 MB常驻大小的分析可能适用于普通应用程序,但大型系统通常有多个具有较大主存的服务器。

有趣的链接:http://cr.yp.to/hardware/ecc.html

不幸的是,海盗链接在页面似乎死了,所以查看海盗链接在这里代替。

其他回答

“宇宙射线事件”在这里的许多答案中被认为是均匀分布的,这可能并不总是正确的(即超新星)。虽然“宇宙射线”的定义(至少根据维基百科)来自外太空,但我认为将局部太阳风暴(又名日冕物质抛射)也包括在同一保护伞下是公平的。我相信这可能会导致几个比特在短时间内翻转,可能足以破坏甚至启用ecc的内存。

众所周知,太阳风暴会对电力系统造成相当大的破坏(如1989年3月的魁北克停电)。计算机系统很可能也会受到影响。

Some 10 years ago I was sitting right next to another guy, we were sitting with each our laptops, it was in a period with quite "stormy" solar weather (sitting in the arctic, we could observe this indirectly - lots of aurora borealis to be seen). Suddenly - in the very same instant - both our laptops crashed. He was running OS X, and I was running Linux. Neither of us are used to the laptops crashing - it's a quite rare thing on Linux and OS X. Common software bugs can more or less be ruled out since we were running on different OS'es (and it didn't happen during a leap second). I've come to attribute that event to "cosmic radiation".

后来,“宇宙辐射”成了我工作场所的一个内部笑话。每当我们的服务器发生了什么事情,我们找不到任何解释,我们开玩笑地把错误归咎于“宇宙辐射”。: -)

好吧,显然是宇宙射线导致丰田汽车的电子设备出现故障,所以我想说这种可能性非常高:)

宇宙射线真的导致了丰田的灾难吗?

更常见的情况是,噪声会破坏数据。校验和可以在很多层面上解决这个问题;在数据线中,通常有一个奇偶校验位与数据一起传输。这大大降低了腐败的可能性。然后在解析级别上,无意义的数据通常会被忽略,因此即使某些损坏确实通过了奇偶校验位或其他校验和,在大多数情况下也会被忽略。

此外,一些组件被电屏蔽以屏蔽噪音(我猜可能不是宇宙射线)。

但最后,正如其他回答者所说,偶尔会有位或字节被打乱,这取决于它是否是有效字节。最好的情况是,宇宙射线扰乱了其中一个空比特,完全没有影响,或者使计算机崩溃(这是一件好事,因为计算机避免了伤害);但最坏的情况,我相信你可以想象。

我曾经为在太空中飞行的设备编程,然后你(据说,没有人给我看过任何关于这方面的论文,但据说这是业内的常识)可以预期宇宙射线总是会导致错误。

Memory errors are real, and ECC memory does help. Correctly implemented ECC memory will correct single bit errors and detect double bit errors (halting the system if such an error is detected.) You can see this from how regularly people complain about what seems to be a software problem that is resolved by running Memtest86 and discovering bad memory. Of course a transient failure caused by a cosmic ray is different to a consistently failing piece of memory, but it is relevant to the broader question of how much you should trust your memory to operate correctly.

基于20 MB常驻大小的分析可能适用于普通应用程序,但大型系统通常有多个具有较大主存的服务器。

有趣的链接:http://cr.yp.to/hardware/ecc.html

不幸的是,海盗链接在页面似乎死了,所以查看海盗链接在这里代替。