The Unix 2038 problem and the art of underestimating
Translated by a model; the original is in Russian.
Runtime Arguments hosts Jim McQuillan and Wolf devote an episode to a class of bugs they argue should have been foreseeable. The starting point is the famous Year 2038 problem.
What happens in January 2038
Unix has long stored time as a 32-bit signed integer — the number of seconds since January 1, 1970. On January 19, 2038, that integer overflows: instead of ticking up, it flips negative and starts counting as if it were 1901. Anything that compares timestamps breaks — for example, make, which decides whether an object file is stale relative to its source.
64-bit systems are immune, the Linux kernel handled it starting with version 5.6 (2020), but a huge population of 32-bit embedded devices remains — from traffic lights to field pressure sensors nobody can easily reach.
Why it happened
McQuillan draws the parallel with Y2K, when years were stored as two digits. He stresses the real constraints behind it: 80-character punch cards, five-megabyte hard disks, writes that consumed a whole sector at a time. Saving every byte wasn't negligence but a reasonable trade-off of its era.
Wolf adds a sharper point: engineering decisions come in two kinds — those made from measurement and those made from feeling. "Nobody will still be running this in 68 years" is a feeling, and feelings almost always mislead. Measuring reality would have been worth it even when the conclusion turns out the same.
A parade of overflows
Then comes a rapid list of failures: the DJ10K scare (that four-digit fields would break when the Dow crossed 10,000 in 1999); the 10-bit GPS week counter rolling over in 1999 and 2019; NTP's rollover due February 7, 2036; Postgres transaction-ID wraparound, tamed by autovacuum; the Boeing 787's 51-day generator bug; NASA's Deep Impact probe, lost to an overflowing tenths-of-a-second counter; the 16-bit limits on PIDs and TCP ports; Discord's trouble with Snowflake IDs, since JavaScript numbers only safely hold 53 bits; IPv4 exhaustion; and a hard-coded expiration field in Blu-ray DRM that turns working players into e-waste on a schedule nobody chose.
Separately, the leap-year bugs: Excel and Lotus believing 1900 was a leap year, the PlayStation 3 bricking on February 29, 2010, and Zune players freezing on December 31, 2008.
The takeaway
Wolf closes on values: write code anyone can fix and maintain, not a lever only you know how to pull. That kind of "job security through obscurity" simply means you'll be pulling the lever over and over again.
Source: Lobsters
Comments
Sign in, to comment.