Safety board shows negative days after 32-bit signed integer rollover mishap
Description
A cartoon-style roadside safety sign sits on two wooden posts against a washed-out desert backdrop. The sign reads, in large red letters centered on the board, “DAYS SINCE LAST” on the first two lines and “INTEGER ROLLOVER” on the third line. In the upper left corner of the sign, a digital counter displays the turquoise number “-2,147,483,648”, the minimum value of a 32-bit signed integer, creating an absurd negative day count. The meme humorously highlights an integer overflow bug where a day counter wrapped around, turning positive time into a gigantic negative value - an inside joke for engineers familiar with two’s-complement limits and rollover incidents. Visually, the muted greens and browns of the background and the exaggerated red headline mimic a workplace “days without accident” board, giving technical context about counters, overflow errors, and the importance of boundary checks
Comments
29Comment deleted
When the safety board flipped to - 2,147,483,648 days, leadership bragged about six million years of zero incidents - turns out unsigned optimism and signed integers don’t mix
The irony is that if this sign's counter is using a 32-bit integer, it'll overflow in about 129 days, resetting to -2,147,483,648 and suddenly claiming we had an integer rollover 5.8 million years ago - which, coincidentally, is exactly how production incidents feel when you're the one who has to fix them at 3 AM
The real tragedy isn't the overflow itself - it's that someone chose a signed integer for a counter that should never be negative. This is what happens when your 'days since incident' tracker becomes the incident. At least they're consistent: if you're going to have an integer overflow, might as well have it on the sign tracking integer overflows. It's the software equivalent of a fire station burning down, except this one was entirely preventable with a uint32_t or, you know, a proper data type for counting days since the Unix epoch. But hey, at least we know exactly when this happened: sometime after 5.8 million years of incident-free operation
When your legacy counter wraps to INT_MIN, proving even time travel can't save 32-bit systems from themselves
Our safety KPI uses int32; after 2,147,483,647 days it wraps to −2,147,483,648, and suddenly we’ve been compliant since before the Unix epoch
We implemented the safety KPI with int32; one overflow later and compliance says we’re safe for the next −2,147,483,648 days - two’s‑complement optimism at enterprise scale
JS joins chat Comment deleted
"-2,147,383,648" Comment deleted
js: "" Comment deleted
JS has no integers limit. Numbers can exceed max_safe_integer_value with loss of precision, soon after they turn into exponential number, and when engine considers that it cannot increase number anymore, the value turns into special Infinity value There is also BigInt type in js which allows to process VERY BIG numbers. It never becomes Infinity and never commits rollover (nor simple numbers do it) JS doesnt know what rollover is Comment deleted
so js has float-like semantics for ints Comment deleted
afaik js only has floats Comment deleted
even lua now has ints Comment deleted
now? You mean it didn't have them from the beginning? Comment deleted
only in 5.4 Comment deleted
is that new, old, ancient…? Comment deleted
that's newest Comment deleted
So they just now added ints Comment deleted
almost a year ago Comment deleted
oh, so the newest release of lua is almost a year old, yes? Comment deleted
yes Comment deleted
Yep, they are stored in IEEE-754 format, 52 bits for ints, 11 for floats and 1 for sign Comment deleted
MAX_SAFE_INTGERER constant is 2^53 - 1 Comment deleted
The fun part is you cannot store 2^53 in the memory to subract one of it Comment deleted
No, you can, but you will instantly lose precision Comment deleted
you're just describing how floats work here, no? and BigInts. Comment deleted
may i introduce you to Haskell Integer type Comment deleted
there is also BigNumber (bn.js) Comment deleted
If this integer was unsigned it would be allways correct Comment deleted