Epic Bugs: Year 2038 Problem

the end is near sign

What are you doing on Tuesday, January 19, 2038 at around 3.14am (GMT)? Sleeping I guess, but beware not to waste your last moments on Earth on some mundane dream. At least make your dream count: for me, early evening on a beach, hum of the sea, gorgeous women in bikinis playing volleyball, all in slow motion (cheesy I know but hey). 

What’s Gonna Happen

When you have a 32 bit computer, and use those 32 bits to store whole (signed) numbers, then your values can range between -2,147,483,648 and +2,147,483,648. 

The Linux way of storing core time is to store the number of seconds since (or before) 1 January 1970 (known as the “epoch”) . Therefore in a 32 bit Linux system, the time will work alright until it reaches +2,147,483,648 seconds past the “epoch”, on 19 Jan 2038 at 3:14. A second later, as it can’t go up anymore, the time will flip to -2,147,483,648 seconds from the “epoch”, meaning 20:45 on 13th December, the year of our Lord 1901, sending all these Linux systems into complete confusion and the world as we know it into chaos.

Who’s Doomed and Who’s Not

But for you and me, no problem, right? We will have our brand new iPhones or Galaxies with not 32 but 1 million and 32 bit processors. Our office laptops (if they exist at all by then) too will be way past this ancient limitation, not to mention hyper-powerful Amazon AWS servers that will be running the world by then. So why worry?

Linux is a very efficient operating system designed for scalability, both up and down. It is the down bit that is a concern. Because it can run on hardware of miniscule power (and price), Linux is the OS of choice for embedded systems. If you are designing a smart toilet system, you’ll stick in it a small processor with 32 bit Linux and some wifi hardware, and your app will tell you when you can flush again - you won’t even have to wait in the room and sing songs to yourself.

Most of these embedded systems are hardwired and not designed for upgrades. Yes, some of them will be naturally replaced with newer versions, but a good number may still be running in 2038 (just think of your grandma’s vacuum cleaner that's probably survived 10 US presidents and counting). Maybe there is a little embedded switch in Kim Jong Un's latest hydrogen bomb? In fact, as late starters, their bombs are probably okay, it’s the ones made 10 to 20 years ago elsewhere in the world  that we should beware of.  

We’ve Seen It All Before

Judging by the anticlimactic outcome of Y2K back at the turn of the millennium, not much will happen this time round. Back then, we were all stocking up on bottled water, VHS videos and smarties and then when the clocks turned midnight…nothing. To this day, the opinions are well divided.

One side says that nothing happened because of diligent and aggressive action to eradicate the Y2K bug ahead of the millennium. Over $300 billion was spent to fix the problem ahead of time and that resulted in only $10 to $20  billion to fix the actual problems after time.

The other side claims that most of those $300 billion were wasted on identifying and fixing irrelevant problems, supporting their stance with the fact that the countries that spent very little money on preventing the problem, like Italy and South Korea, didn’t spend more money than others on correcting the problem after it occurred.

You be the judge of what will happen in 2038. The trouble is, you can’t even stock up on videos these days - it’s all streamed. I guess it'll be just smarties for us then, lots and lots of smarties…

Post Scriptum

13th December 1901 is a Friday. It all starts making sense now.

Leave a reply

Your email address will not be published. Required fields are marked*