The year-2038 bug is similar to the Y2K bug in that it involves a time-wrap problem not handled by programmers.The year 2038 problem may cause some computer software to fail at some point near the year 2038.
The problem affects all software and systems that both store system time as a signed 32-bit integer, and interpret this number as the number of seconds since 00:00:00 UTC on Thursday, 1 January 1970. Modern computers use a standard 4 byte integer for this second count. This is 31 bits, storing a maximum value of 231. The remaining bit is the sign. This means that when the second count reaches 2147483647, it will wrap to -2147483648. In other words, the furthest time that can be represented this way is 03:14:07 UTC on Tuesday, 19 January 2038. Times beyond this moment will “wrap around” and be stored internally as a negative number, which these systems will interpret as a date in 1901 rather than 2038. This is caused by integer overflow.
What could happen? Well we’ve actually already seen some of the effects of this bug. In May of 2006 the bug brought an AOL web server to its knees and took out the Mars Rover Spirit temporarily in 2004. This means for computer programs and systems that haven’t been fixed will face consequences similar those predicted with the Y2K bug.
There is no universal solution for the Year 2038 problem. Any change to the definition of the time_t data type would result in code compatibility problems in any application in which date and time representations are dependent on the nature of the signed 32-bit time_t integer. However, the architecture change from 32-bit to 64-bit means that time_t can be changed (without hurting binary compatibility) to match the machine word size of 64-bits, thus eliminating the problem on computers that use newer 64-bit operating systems. Most operating systems designed to run on 64-bit hardware already use signed 64-bit time_t integers, effectively eliminating the Year 2038 problem in any software that has been developed to use the extended format.
So there is nothing to worry about because neither the world nor the Internet will end in 2038. In fact with over 25 years to spare I’m pretty confident that any issues will be resolved before the doomsday scenario has a chance to play out.
Leave a Reply