Integer overflow: Difference between revisions

Content deleted Content added
m Reference fix.
Line 95:
An unhandled arithmetic overflow in the engine steering software was the primary cause of the crash of the 1996 maiden flight of the [[Ariane 5 Flight 501|Ariane 5]] rocket.<ref>{{cite web|last=Gleick|first=James|title=A Bug and A Crash|url=http://www.around.com/ariane.html|work=New York Times Magazine|accessdate=9 December 2013|date=1 December 1996}}</ref> The software had been considered bug-free since it had been used in many previous flights, but those used smaller rockets which generated lower acceleration than Ariane 5.
 
On 30 April 2015, the [[Federal Aviation Authority]] announced it will order [[Boeing 787]] operators to reset its electrical system periodically, to avoid an integer overflow which could lead to loss of electrical power and [[ram air turbine]] deployment, and Boeing deployed a [[software update]] in the fourth quarter.<ref>{{cite news |title= F.A.A. Orders Fix for Possible Power Loss in Boeing 787 |first=Jad|last=Mouawad|work= [[New York Times]] |date= 30 April 2015 |url= https://www.nytimes.com/2015/05/01/business/faa-orders-fix-for-possible-power-loss-in-boeing-787.html?_r=0}}</ref> The [[European Aviation Safety Agency]] followed on 4 May 2015.<ref>{{cite web |url= http://ad.easa.europa.eu/ad/US-2015-09-07 |work= Airworthiness Directives |title= US-2015-09-07 : Electrical Power – Deactivation |date= {{date|2015-05-04}} |publisher= [[European Aviation Safety Agency]]}}</ref> The error happens after 2³¹ centiseconds ({{#expr:2^31/100/3600/24}} days), indicating a 32-bit [[Signed number representations|signed]] [[Integer (computer science)|integer]].
 
Overflow bugs are evident in computer games. In the arcade game ''[[Donkey Kong]]'', [[Kill screen|it is impossible to advance past level 22]] due to an integer overflow in its time/bonus. The game takes the level number a user is on, multiplies it by 10 and adds 40. When they reach level 22, the time/bonus number is 260, which is too large for its 8-bit 256 value register, so it resets itself to 0 and gives the remaining 4 as the time/bonus – too short to finish the level. In ''[[Donkey Kong Jr. Math]]'', when trying to calculate a number over 10000, it shows only the first 4 digits. Overflow is the cause of the famous ''[[kill screen|Split Screen]]'' in Pac-Man<ref>{{cite web|url=http://home.comcast.net/~jpittman2/pacman/pacmandossier.html|title=The Pac-Man Dossier|author=Pittman, Jamey}}</ref> and the ''Nuclear Gandhi'' in [[Civilization series]].It also caused the Far Lands in Minecraft which existed from the Infdev development period to Beta 1.7.3, however it was later fixed in Beta 1.8 but still exist in the Pocket Edition and Windows 10 Edition versions of Minecraft.<ref>{{cite web|url=http://minecraft.gamepedia.com/Far_Lands|title=Minecraft Gamepedia Page|author=Minecraft Gamepedia}}</ref>
 
[[File:Error message due to an integer signedness bug in the stack setup code of MASM 1.00.gif|thumb|An integer signedness bug in the stack setup code emitted by the Pascal compiler prevented Microsoft / IBM MACRO Assembler Version 1.00 (MASM), a DOS program from 1981, and many other programs compiled with the same compiler, to run under some configurations with more than 512 KB of memory.]]
Microsoft / IBM MACRO Assembler (MASM) Version 1.00, and likely all other programs build by the same Pascal compiler, had an integer overflow and signedness error in the stack setup code, which prevented them from running on newer DOS machines or emulators under some common configurations with more than 512 KB of memory. The program either hangs or displays an error message and exits to DOS.<ref>{{cite web|url=https://slions.net/threads/debugging-the-ibm-personal-computer-macro-assembler-masm-version-1-00.33/|title=Debugging IBM MACRO Assembler Version 1.00|authorlast=Lenclud, |first=Christophe}}</ref>
 
In August 2016, a Casino machine at Resorts World Casino printed a prize ticket of $42,949,672.76 as a result of an overflow bug. The Casino refused to pay this amount calling it a malfunction, using in their defense that the machine clearly stated that the maximum payout was $10,000, so any prize higher than that had to be the result of a programming bug. The Iowa Supreme Court ruled in favor of the Casino. <ref>{{cite web|url=https://arstechnica.com/tech-policy/2017/06/sorry-maam-you-didnt-win-43m-there-was-a-slot-machine-malfunction/?comments=1|title=Sorry maamma'am you didn't win 43m$43M – there was a slot machine "'malfunction"'|first=David|last=Kravets|date=June 15, 2017|website=Ars Technica}}</ref>
 
==See also==