The Y2K+38 Problem
Remember Y2K? That was chump change compared to what's coming on January 19, 2038. For a long time up until the end of the twentieth century (even now on certain Unix-based systems) the time and date was stored and manipulated in C and C++ code using a 32-bit signed integer called time_t. This integer stored the number of seconds that have passed since what is called the epoch, which marked midnight on January 1, 1970. 32-bit signed integers can hold numbers up to 2^31 - 1, (the remaining bit reflects the positivity or negativity of the number (kind of)), or about 2 billion and change.
The problem, which will occur at 1/19/2038 03:14:07, is that we'll run out of seconds, and time_t will try to roll over. And it won't roll over to 1970, but since time_t is signed, it'll think the time is suddenly 2^31 seconds before 1970, which falls out to the evening of December 13, 1901.
It's not as simple as Y2K was, in that machines will simply think it's near the tragic end of the McKinley administration. Most programs aren't set up to handle the case of time being negative, and horrible bugs will arise that no programmer would have thought of preparing for. After all, if a programmer were to handle the case of time suddenly going negative, (s)he would also probably not have used time_t in the first place.
Most modern systems use 64-bit numbers to store the time (in milliseconds) now, with the 32-bit numbers being held over from the 90s, when 32-bit computing was the best we had. 2^63 milliseconds after 1970 will put us several years past the expected heat death of the universe, so I'm less concerned about that. But if the last 50 years of computing has taught us anything, it's that a piece of software can be safely declared dead only after it's been taken offline of every system it was ever installed on, the installation media and all source code has been destroyed, and if all of the programmers involved in writing it have been taken out into the street and shot. Credit to Ted Neward for that bit of insight.


1 Comments:
Indeed it is. I fully plan on funding my retirement with exorbitant consulting fees based around this problem. We'll be about 60 then, which is the right age for the "esteemed gray-headed consultant" role.
Time is a big deal. I don't know how many billions of dollars have been spent just working with it and trying to make sense of it.
Post a Comment
<< Home