Catastrophes Caused by Programming Language Defects

What's covered: documented cases where precision loss, underflow, overflow, division by zero, null pointer dereference/NPE, and stack overflow led to deaths, injuries, aviation accidents, loss of spacecraft, military equipment failures, power plant/grid disruptions, stock exchange crashes, and blockchain incidents.

What's NOT included: missing characters in commands (Mariner 1, Phobos 1), gotofail SSL, race conditions without an arithmetic component, unit conversion errors (Mars Climate Orbiter), sensor failures without overflow. These cases are well-known but belong to other defect classes and therefore don't fit the Awsum argument.

Purpose: justifying the value of Awsum, in which the listed defect classes are eliminated at the language level.

Aviation and Space

1.1. Ariane 5, Flight 501 — June 4, 1996

1.3. Boeing 787 Dreamliner — Generator Control Unit, 2015

Military Equipment

2.1. Patriot PAC-2, Dhahran — February 25, 1991

Medical Equipment

3.1. Therac-25 — 1985–1987

Stock Exchanges and Financial Markets

5.1. Vancouver Stock Exchange index — 1982–1983

Blockchain and DeFi

Cryptocurrency protocols have produced two distinct flavours of language-level arithmetic disasters. The earliest — case 6.1 below — was a C++ overflow in Bitcoin Core itself. The later cases (6.2+) come from Solidity prior to version 0.8.0, which lacked checked arithmetic by default and required programmers to use SafeMath manually. Awsum-like guarantees (overflow in any arithmetic produces a compile-time error or explicit handling) would zero out the entire class.

6.1. Bitcoin Value Overflow Incident — August 15, 2010

6.2. BatchOverflow (BEC) — April 22, 2018

6.3. ProxyOverflow (SMT et al.) — April 24, 2018

6.4. Poolz Finance — March 15, 2023

6.5. Raft Protocol — November 10, 2023

6.6. Abracadabra Money (Cauldron V4) — January 30, 2024

6.7. Sonne Finance — May 14, 2024

6.8. Velocore V2 — June 2, 2024

6.9. zkLend — February 2025

6.10. 1inch Fusion v1 resolvers — March 5, 2025

6.11. Systematics of blockchain cases

Solidity prior to 0.8.0 (December 2020) did not perform overflow checks by default — programmers had to use SafeMath manually. After 0.8.0 the language reverts on overflow, but unchecked { ... } blocks, forks of legacy code, and division-heavy DeFi math (rounding / precision-loss bugs in share-token, exchange-rate, and fee calculations) continue to produce vulnerabilities of the same language-level arithmetic class. A 2025 systematic review (Rezaei et al., "SoK: Root Cause of $1 Billion Loss in Smart Contract Real-World Attacks", arXiv:2507.20175) catalogs arithmetic over/underflow and precision loss among the 24 active (still-exploitable) vulnerability classes in 50 major attacks 2022–2025. The paper does not break the $1.09B total down by class; for the named arithmetic-class incidents in its catalogue (cases 6.5–6.9 above), publicly reported losses sum to ~$46M, a lower bound that excludes the pre-Solidity Bitcoin case (6.1), the pre-0.8.0 Solidity cases (6.2–6.4), and the long tail of unaudited contracts. Case 6.10 (1inch Fusion v1, ~$5M) sits adjacent to this set: the arithmetic underflow there appeared as a step in a wider buffer/calldata-corruption attack rather than as the primary defect, so its loss is documented separately and not included in the $46M arithmetic-primary sum.

Famous Quote: Tony Hoare on null

In 2009, at the QCon conference, Sir Tony Hoare (creator of Quicksort, 1980 Turing Award laureate) publicly apologized for inventing the null reference in ALGOL W in 1965:

"I call it my billion-dollar mistake. It was the invention of the null reference in 1965. (…) I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years."

Hoare himself acknowledged that "billion" is a lower bound: he estimated the actual cumulative damage from NPE/NullPointerException in Java, NullReferenceException in .NET, and segfaults in C/C++ over 60 years as "somewhere between $100 million and $10 billion." Modern estimates are an order of magnitude larger.

Awsum eliminates null as a value of a reference type: there is no "empty" state for a reference type — absence is represented by an explicit constructor (Maybe, Either). This closes the classical NPE / segfault.

It is worth being precise about what this does not cover in other languages often grouped together for this property. Haskell still has undefined / error inhabiting every type; Rust has panic! / .unwrap(); Swift has the ! force-unwrap and implicitly-unwrapped optionals; F# inherits null from .NET interop on every reference type imported from the BCL or C#; Idris has believe_me and is partial-by-default unless totality is explicitly enforced. Each of these is the same class of bug Hoare was complaining about — "a value the type admits, but the program crashes on" — under a different name.

Awsum has no language construct for a bottom value: no undefined, no error, no panic, no force-unwrap. Combined with mandatory exhaustiveness in case (a missing constructor is a compile error, not a runtime exception), this means "a value of type T that crashes the program" does not exist — not just for null, but for the wider family.

Aggregate estimates of damage from software defects

9.1. NIST 2002 — estimate of $59.5 billion/year for the US

The NIST/RTI study "Planning Report 02-3: The Economic Impacts of Inadequate Infrastructure for Software Testing" estimated the direct annual damage to the US economy from software defects at $59.5 billion (≈0.6% of GDP). Of this:

  • $1.8 billion — transportation manufacturing (CAD/CAM/CAE/PDM, aerospace+automotive).
  • $3.3 billion — financial services.
  • About $22.5 billion of the $59.5 billion could have been eliminated by improving testing infrastructure.

Among the elements of the CISQ Automated Source Code Reliability Measure (the structure of CWE categories that forms this number), explicitly listed are: null pointer dereference (CWE-476), division by zero (CWE-369), uncaught exception, stack overflow, and related weaknesses.

9.2. CISQ 2022 — estimate of $2.41 trillion/year for the US

Twenty years after the NIST study, the CISQ consortium (co-founded by OMG and SEI Carnegie Mellon) estimated the cost of poor software quality in the US at $2.41 trillion for 2022, of which:

  • $1.56 trillion — operational failures (actual downtime, incidents, damage from cyber-attacks via existing vulnerabilities).
  • $260 billion — failed projects.
  • $1.52 trillion — accumulated technical debt.

That's a ~40× growth over two decades. CISQ explicitly lists buffer overflow, integer overflow, null pointer dereference, division by zero among the weaknesses that form this number (CISQ Automated Source Code Quality Measures).

9.3. CWE Top 25 — where our defects sit in the real CVE dataset

CWE Top 25 Most Dangerous Software Weaknesses (MITRE) ranks weaknesses by real CVE frequency and severity.

In the 2024 edition:

  • CWE-476 (NULL Pointer Dereference) — #11. 1,625 CVEs, average CVSS 5.8. Score 15.34.
  • CWE-190 (Integer Overflow or Wraparound) — #23. Score around 7.x by various estimates.

In the 2025 edition MITRE's methodology changed (decomposing abstract classes into specific children) — positions reshuffled, but the classes remained near the top:

  • CWE-476 rose to #13.
  • CWE-190 dropped to #30 (formally outside the Top 25, but specific buffer-overflow variants CWE-120/121/122 climbed in, which are often consequences of integer overflow).

Summary table

Incident Year Defect class Casualties Direct damage
Therac-25 1985–87 byte overflow + race ≥3 dead, ≥3 severely injured lawsuits, FDA Class I recall
Vancouver Stock Exchange 1982–83 precision loss (truncation) 0 years of distorted index
AT&T network collapse (mentioned indirectly) 1990 C break mishandling, not arithmetic 0 ~$60 million, 70 million failed calls
Patriot Dhahran 1991 fixed-point precision 28 dead, ~100 injured strategic failure
Ariane 5 Flight 501 1996 int16 overflow 0 $370–500 million + 4 Cluster satellites
Bitcoin Value Overflow 2010 int64 overflow in tx output sum 0 ~9 hours of chain rolled back, no $ loss
Boeing 787 GCU 2015 int32 counter overflow 0 (caught in lab) potentially — loss of AC power in flight
BEC BatchOverflow 2018 int overflow in multiplication 0 ERC-20 trading suspensions on major exchanges
SMT proxyOverflow 2018 int overflow in addition 0 trading suspensions
Poolz Finance 2023 int overflow 0 ~$390k
Raft Protocol 2023 precision loss in share-token mint 0 ~$3.3M proceeds (~$6.7M unbacked R minted)
Abracadabra Money (Cauldron V4) 2024 precision loss in borrow/repay 0 ~$6.5M, MIM stablecoin depeg
Sonne Finance 2024 precision loss / rounding 0 ~$20M (~$6.5M rescued)
Velocore V2 2024 underflow in fee math 0 ~$6.8M
zkLend 2025 precision loss / rounding 0 ~$9.5M, protocol shut down
1inch Fusion v1 resolvers 2025 underflow as step in calldata corruption 0 ~$5M (resolver operators)

The case for Awsum

The incidents above demonstrate that runtime defects in numerical and reference arithmetic continue to kill people and burn billions of dollars 60+ years after these defect classes were first identified. The standard "industry" answer is external tooling: SafeMath in Solidity, MISRA-C for embedded systems, static analyzers, formal verification. All of these tools are external to the language. They are optional, require discipline, and every missed SafeMath call is a potential BatchOverflow.

Awsum closes this gap through:

  1. No null as a valid value of a reference type — Hoare's mistake closed at the type-system level. Optional values must be Maybe; the compiler refuses to compile code that doesn't handle the absence case, and exhaustiveness is checked without a catch-all _ escape. null, nil, undefined, and NaN are not values of any type in the language.
  2. Honest integer arithmetic via Either — closing the Ariane 5 / Boeing 787 / Patriot / Vancouver / Therac-25 / BatchOverflow class. Every integer operation that can leave its range — overflow, underflow, precision loss, division by zero — returns Either with a typed error variant. The programmer must handle the error case explicitly; ignoring it is a compile error. No silent wrap, no Infinity, no -0. The same byte-identical behaviour on JVM, CLR, JavaScript, WebAssembly, and LLVM regardless of the host platform's native integer semantics.
  3. Stack-safe recursion of any shape — closing the unbounded-recursion class. Self, mutual, and non-tail recursion compile to a bounded-stack loop on every backend, including JVM and JS where the host platform has no native cross-method tail calls. No tailRecM, no manual trampolines, no "stack-safe in our test suite, blows up in production on the JVM."
  4. Platform effects gated at compile time — closing the runtime-surprise class. Each effect is bound to the program-types it can run under; using a browser-only effect in a CLI program (or vice versa) is a compile error, not a 3 AM page.
  5. No silent decisions — closing the broader "I thought this value had a different type" / "I thought I was modifying the outer x" class. No defaulting of integer literals (the compiler never picks a type for the user), no implicit numeric coercion, no shadowing of any visible name by an inner binder. Closed sum types make every "what can this value be?" answerable from the type signature alone.

Each of these guarantees moves the defect from runtime to compile-time — for every line of application code, on every supported backend.

General overview sources

Document last reviewed on April 30, 2026.