Unix Millennium Bug

The Unix Millennium Bug started getting noticed (in 2006), exactly a billion seconds before its sceduled execution, after there were some mysterious crashes which were finally traced to the definition of time_t in unix-like operating systems (and more generally, in the ubiquitous C (the programming language)). From a thread in PIClist, I also found this webpage which claims to have been written in 2003 (in case the opening paragraph looks familiar to you, yes, the whole page is a mostly plagarised version of the programming challenge in the introduction to the excellent book Expert C Programming by Peter Van Der Linden, a book I would recommend to anyone).

People’s opinion on the possible impact of the event is mostly based on their opinion about the backward compatibility of the technology we would be using in 2038 (like time_t failing to be a 64 bit unsigned integer (universally) by 2038. by the way, int is still 32 bit in x64 linux and windows). So I am not going to offer one (opinion, analysis, prediction), because, most probably, the reader already has one.

It puzzles me, though. Peter Van Der Linden’s book (Expert C Programming, a very entertaining and informative book that can be read just for the kicks) came out in 1994 (excuse me of one more pair of brackets, but while trying to locate the first publication date, I came across an almost unnoticable passage in the midst of copyright notices, which describes the story behind the cover, about a fisherman in 1938 who caught and then stuffed a coelacanth (all Dirk Gently fans will recall the fish which caused the extinction of the Dodo) he had caught, which was a fish believed to have been extinct for 70 million years!). And as the book tells us, even the guy writing the word-processor source for the man pages of original tunefs had time enough to kid around and comment on the wrap around of time_t. So even though I don’t write production grade C-code, I suspect that the knowledge about time_t’s wrap around would be common among those who do.

I’ll quote one intersting question from the book. Since the value of time_t will depend on the time set in the computer (locally), which country will be the first one to be affected?

Well, the obvious answer (in terms of GMT) is the wrong one!

Places in southern hemisphere will be on DST (daylight savings time) in January. New Zealand, being in the easternmost timezone, will be the first one to be hit by the ‘bug.’

I’ll end with the concluding remarks of Peter Van Der Linden on this topic, “Anyone who thinks programming dates is easy to get right the first time probably hasn’t done much of it.”


Incorrigible Introvert

I wouldn't pretend I have a worthy tale to tell, I have only the ramifications of a twisted mind to sell.
This entry was posted in Opinions, technical, The Diary of a Fugitive. Bookmark the permalink.

One Response to Unix Millennium Bug

  1. congratulations. Sounds fantatic. I love the picture.

Leave a Reply