Main      Site Guide    
Message Forum
The Y2038 problem: Another Y2K?
Posted By: Wolfspirit, on host 216.209.218.105
Date: Tuesday, January 11, 2000, at 20:21:27

Y2K seemed a big problem, no doubt, but there is perhaps an even bigger one looming out there, Y2038. This is the date that will affect machines running the Unix operating system -- and that includes most of the powerful computers sorting and routing packets of data throughout major networks. Unix stores time as the number of seconds elapsed since January 1, 1970, the beginning of the decade in which it was invented at Bell Labs. Unfortunately, some Unix-based computer systems will run out of space to store these seconds at 3:14:07 a.m. on January 19, 2038. What kind of systems run Unix? Oh, just ones like financial banking systems, airlines, and the Internet.

But seriously, why should anyone worry about a problem more than 38 years hence?

First, seemingly distant dates can have a very near-term impact. Payments on a 30-year mortgage issued in 2009, for example, must be calculated beyond the rollover date for Unix machines.

And secondly, software tends to be stubbornly persistent. Programmers assumed back in 1970 that by the end of the century, the code they were writing would have long been replaced. But it turns out that while hardware gets updated regularly, old software often becomes the foundation upon which new programs are built...

Unix is a fine operating system that had its raw beginnings in the late 1960's. The early Unix programmers, who rewrote their O/S code in C, came up with a way to save files that differs from the way that causes the Y2K problem: they set the save time as the number of seconds since the first second of midnight on January 1, 1970, or "Time Zero." The files are stored as the number of seconds that have passed since Time Zero. That's fine, but there is one small glitch. UNIX's C/C++ runtime libraries declare a time_t counter as a 32-bit (signed) number to count the number of seconds, which means that there's only a finite number of the latter: ±2^32, or one-half of 4¼ billion seconds after Time Zero. When Time finally "runs out" on January 19, those Unix computers will think it's 1970 again.

This is somewhat different than the Y2K problem, yet it derives from the same programming restrictions that existed years ago. Y2K is with us because layers of software have been laid down by thousands of programmers over the past 40 years, and the top layers are vulnerable to any vagaries of the bottom layers. In Y2K's particular case, the 99 to 00 date rollover problem can be traced back to an obsolete hardware limit in the RTC clock -- which turns out to have been a designed shortcut to conserve on then-expensive memory space. Unfortunately, to maintain backwards compatibility with existing clock architecture, this old limit has biased the time representations in all PC hardware and software programming since then.

With respect to PC's, some experts say that date problems with Microsoft's operating systems and application programs may prove to be more serious than those of Unix. This is because unlike Unix programs -- which all represent time in the same way -- Microsoft's programs have been cobbled together over decades from many sources, and time representations vary widely. As a result, the websites Microsoft created to help customers deal with clock-related problems show program expiration dates ranging from 1999 to "future centuries." One example is with the MS programming language Visual C++, which measures time as seconds elapsed since January 1, 1900, and it will rollover to zero in 2036. Because Visual C++ is among the most popular languages in use today, many applications being written throughout the industry today could fail in that year. No one knows for sure what will happen, but Y2K is a pretty good indicator of what to expect.

The computer industry is already addressing some long-term issues. The newest generation of Unix machines, for example, now define their counters in 2^64 numbers, which will not run out of clock space for at least another 290 billion years -- or long after the sun has swallowed up Earth.


Wolf "a moral obligation for programmers to design code as best as they can: Because future generations will build upon our unseen mistakes" spirit


Link: Link to previous

Replies To This Message