- 论坛徽章:
- 2
|
回复 34# sacry
Great!
我勤快,弄个排字版:
Undefined Behavior Causes CPU Meltdown in IBM PC's!
The suggestion of undefined software behavior causing CPU meltdown isn't as farfetched as it first appears.
The original IBM PC monitor operated at a horizontal scan rate provided by the video controller chip. The flyback transformer (the gadget that produces the high voltage needed to accelerate the electrons to light up the phosphors on the monitor) relied on this being a reasonable frequency.
However, it was possible, in software, to set the video chip scan rate to zero, thus feeding a constant voltage into the primary side of the transformer. It then acted as a resistor, and dissipated its power as heat rather than transforming it up onto the screen. This burned the monitor out in seconds. Voilà: undefined software behavior causes system meltdown!
呃,观点还是前面的:
1. 这其实是在说"undefined software behavior", 以及与C语言的undefined behavior无关了
2. "set the video chip scan rate to zero" 的行为是良好定义的, 肯定能把它设置为0, 否则就不会烧毁了。
这段文字前面还有一段话:
since the behavior is undefined, the compiler is free to do anything and doesn't even have to warn you about it!
但设置为0, 编译器是必须老老实实做这件事的。
总之,C语言的undefined behavior引起严重事故的可能性不能说绝对没有。
但IBM的这个不能作为论据,它不是C语言的undefined behavior引起的,而且正是因为C语言是规规矩矩听了程序员的话、做了该做的事才会被烧毁的。。。 |
|