Integer overflow: Difference between revisions

Content deleted Content added
Methods to mitigate integer overflow problems: Static analysis tools, formal verification and design by contract relevant to "avoidance" method
Examples: build -> built
Line 100:
 
[[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 buildbuilt 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|last=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|title=Sorry ma'am you didn't win $43M – there was a slot machine 'malfunction'|first=David|last=Kravets|date=June 15, 2017|website=Ars Technica}}</ref>