Runtime Arguments

37: Unix Year 2038 problem and the art of underestimating

Jim McQuillan & Wolf Episode 37

Use Left/Right to seek, Home/End to jump to start or end. Hold shift to jump forward or backward.

0:00 | 1:03:25

Jim walks through the classic 2038 problem — Unix's 32-bit signed timestamp (seconds since Jan 1, 1970) overflows on January 19, 2038, flipping negative and breaking anything that depends on file/time comparisons (e.g., Make). He compares it to Y2K, tracing the two-digit-year decision back to real storage constraints of the era — punch cards (80 characters each), early hard disks with fixed-size sectors — and argues those were reasonable trade-offs for their time, not simply negligence. That leads into a side discussion (Wolf) about engineering decisions made from measurement versus decisions made from feeling — and why the former holds up better over decades.

Also covered: the "DJ10K" problem (fear that 4-digit stock-ticker fields would break when the Dow crossed 10,000 in 1999), and how the 2038 fix has rolled out — 64-bit systems are fine, Linux kernel 5.6+ (2020) handles it, filesystem support varies (ext4 and btrfs/xfs are fine with proper config, older ext3 is not). They compare how databases store timestamps: Postgres' 64-bit timestamptz (good until year 294,276), MySQL's 5-byte datetime, SQLite's lack of a native date type (stored as ISO 8601 strings), and DuckDB's 64-bit microsecond timestamps.

The episode then runs through a rapid-fire list of real-world overflow/rollover bugs:

  • GPS's 10-bit week counter, which has already rolled over in 1999 and 2019, and will again in 2038 and 2058 (moving to 13 bits)
  • NTP's 32-bit unsigned rollover coming February 7, 2036
  • Postgres transaction ID (XID) wraparound, and how autovacuum (added in Postgres 8, 2005) prevents it
  • The Boeing 787's 51-day generator bug (all four generator control units can fail simultaneously if not power-cycled)
  • NASA's Deep Impact probe, lost after a 32-bit tenths-of-a-second counter overflowed
  • 16-bit limits on PIDs and TCP port numbers
  • Discord's issues with Twitter-style 64-bit Snowflake IDs, since JavaScript numbers only safely hold 53 bits
  • IPv4 address exhaustion and the slow IPv6 transition
  • AACS DRM's 32-bit hard-coded expiration field, which can make Blu-ray discs/players stop working on a schedule nobody chose

Then a set of leap-year date bugs: Excel/Lotus's belief that 1900 was a leap year (it wasn't — a refresher on the "divisible by 4, except by 100, except by 400" rule), the Sony PlayStation 3 bricking on Feb 29, 2010 (which wasn't a leap year), and the Microsoft Zune's clock freeze on Dec 31, 2008.

Closing thought: Wolf ties it back to values — writing software that's fixable and maintainable by anyone, not code where you're the only one who can "pull the lever" (job security through obscurity), which Jim agrees is admirable but ultimately counterproductive.

Hosts:
Jim McQuillan can be reached at jam@RuntimeArguments.fm
Wolf can be reached at wolf@RuntimeArguments.fm

Follow us on Mastodon: @RuntimeArguments@hachyderm.io

If you have feedback for us, please send it to feedback@RuntimeArguments.fm

Check out our webpage at http://RuntimeArguments.fm

Theme music:
Dawn by nuer self, from the album Digital Sky

People on this episode

Podcasts we love

Check out these other fine podcasts recommended by us, not an algorithm.

CoRecursive: Coding Stories Artwork

CoRecursive: Coding Stories

Adam Gordon Bell - Software Developer
Two's Complement Artwork

Two's Complement

Ben Rady and Matt Godbolt
Accidental Tech Podcast Artwork

Accidental Tech Podcast

Marco Arment, Casey Liss, John Siracusa
Python Bytes Artwork

Python Bytes

Michael Kennedy and Calvin Hendryx-Parker
Talk Python To Me Artwork

Talk Python To Me

Michael Kennedy