Time's Up: 2^30 Seconds Since 1970 675
An anonymous reader writes: "In Software glitch brings Y2K deja vu, CNET points out a small wave of Y2K-like bugs may soon hit, though it gets the explanation wrong. It will soon be about 2^30 (1 billion, not 2 billion) seconds since 1970 (do the arithmetic). Systems that use only 29 bits of a word for unsigned/positive integers, or store time as seconds since 1970 in this format, may roll back to 1970. (Many systems that do not need full 32 bit integers may reserve some bits for other uses, such as boolean flags, or for type information to distinguish integers from booleans and pointers.)"
RTFA (Score:3, Informative)
Re:Some systems... (Score:0, Informative)
Re:RTFA (Score:5, Informative)
The article specifically states that Unices use unsigned 32-bit values to store the number of seconds since 1970. Unfortunately, it's wrong even in that respect, since most Unices have been using larger timevals for some time now.
It's fun to bash SCO and all, but come on.
How many seconds you have left: (Score:5, Informative)
Re:subject (Score:3, Informative)
Its interesting, how no one considered this would happen eventually and just started to use 64 bit ints to store this from the long run.
Someday, we will hit a very high year, and these sort of problems will hit us as well
No sympathy for these guys (Score:4, Informative)
Re:Some systems... (Score:5, Informative)
So maybe a Lisp Machine might have this problem? Of course, Lispers will tell you that they'd always have the sense to use a bignum
31 bit architecture is very common (Score:3, Informative)
Did the math. (Score:5, Informative)
Okay -- I did the math, and 2^29 seconds since January 1st 1970 would have been up on January 4th, 1987.
2^30 seconds since the epoch puts us into January 9th, 2004.
Yaz.
i doubt much unix software is affected (Score:1, Informative)
The 2**30 rollover in January strikes me as pretty unlikely to affect much. Are there any commonly used 31-bit archs? (I think IBM s390 is but only for addressing, not data - please correct me if I'm wrong) In 18 years of working on UNIX software I don't think I've ever seen code to "cleverly" re-use the high bits on a time_t variable for something else.
Oh well, back to waiting for 2038. I should be retired by then, have fun kids!
1 billion != 2^30 (Score:2, Informative)
My arithmetic says that 1 billion = 1,000,000,000 whereas 2^30 is 1,073,741,824.
The 1 billion rollover happened back in September 2001. The 2^30 rollover is in a few weeks time.
Re:I don't think there are 31-bit architectures (Score:5, Informative)
Re:I don't think there are 31-bit architectures (Score:5, Informative)
Re:subject (Score:1, Informative)
Re:I don't think there are 31-bit architectures (Score:5, Informative)
Of course you're wrong
The IBM OS/390 and Z/OS operating systems, which run on most IBM mainframes, are both 31-bit.
Re:RTFA (Score:5, Informative)
Actually, it's wrong in that POSIX states this value is signed, which is what causes it to be a problem we have to worry about before the next century. (If time_t was unsigned, various functions, such as time(2) could not return an error code. Similar deal happened with other types, such as size_t, which lead to the 2GB file problem for awhile.)
Re:RTFA (Score:3, Informative)
yup... (Score:5, Informative)
antitux@TuX0r:~$ perl 2038.pl
Tue Jan 19 03:14:01 2038
Tue Jan 19 03:14:02 2038
Tue Jan 19 03:14:03 2038
Tue Jan 19 03:14:04 2038
Tue Jan 19 03:14:05 2038
Tue Jan 19 03:14:06 2038
Tue Jan 19 03:14:07 2038
Fri Dec 13 20:45:52 1901
Fri Dec 13 20:45:52 1901
Fri Dec 13 20:45:52 1901
antitux@TuX0r:~$
hrm..
Looks like we're fucked too.
Re:yup... (Score:3, Informative)
antitux@TuX0r:~$ uname -a
Linux TuX0r 2.6.0 #4 Sat Dec 20 18:38:44 MST 2003 i686 unknown unknown GNU/Linux
antitux@TuX0r:~$
Re:A note about the "funnies" (Score:5, Informative)
There were, in fact, many problems that were found and fixed before they did any harm.
A lot of infrastructure was upgraded on somewhat dubious claims of Y2K problems. In some cases, resetting the system clock once on 1/1/00 would have sufficed.
Consulting firms and contractors had a feeding frenzy. Some added value, others did not.
Many corporations were frightened by the prospect of lawsuits that might occur if they had Y2K problems. Lawfirms were licking their chops with anticipation.
As a result of all of the above, for the only time in recorded history CIOs could get whatever they wanted. Naturally, they played it safe. Wouldn't you?
rash of naughty dates coming (Score:5, Informative)
02/06/2036 - systems which use unsigned 32-bit seconds since 01/01/1900
01/01/2037 - NTP time rolls over
01/19/2038 - Unix 32 bit time, signed 32 bit seconds (that's to say, 2^31) since 01/01/1970
02/06/2040 - Older Macintosh
09/17/2042 - IBM 370 family mainframe time ends, 2^32 "update intervals, a kind of 'long second'" since 01/01/1900
01/01/2044 - MS DOS clock overflows, 2^6 years since 01/01/1980
01/01/2046 - Amiga time overflows
01/01/2100 - many PC BIOS become useless
11/28/4338 - ANSI 85 COBOL date overflow, 10^6 days since epoch of 01/01/1601
and my personal favorite,
07/31/31086 - DEC VMS time overflows
Re:31 bit architecture is very common (Score:3, Informative)
36 bits was fairly common once upon a time, but no longer. Unisys still have a 36-bit series, but they're the last of the breed. See here. [36bit.org]
Big scary IBM boxes are where you see the 31 bit weirdness.
Re:Some systems... (Score:5, Informative)
Re:Yeah, but most of us are fine... (Score:2, Informative)
Re:rash of naughty dates coming (Score:5, Informative)
I'd like to add to that January 1st, 2032, which is when the date structure in older Macs and PalmOS devices will overflow.
Yaz.
This Only Hits 1 Company! Who Cares? (Score:3, Informative)
Not if you have a 64 bit machine :) (Score:1, Informative)
Tue Jan 19 03:14:01 2038
Tue Jan 19 03:14:02 2038
Tue Jan 19 03:14:03 2038
Tue Jan 19 03:14:04 2038
Tue Jan 19 03:14:05 2038
Tue Jan 19 03:14:06 2038
Tue Jan 19 03:14:07 2038
Tue Jan 19 03:14:08 2038
Tue Jan 19 03:14:09 2038
Tue Jan 19 03:14:10 2038
$ uname -mrs
Linux 2.4.9-40smp alpha
$ perl -v
This is perl, v5.6.0 built for alpha-linux
Copyright 1987-2000, Larry Wall
Re:How many seconds you have left: (Score:5, Informative)
$ echo seconds left: $(((1 << 30) - `date +%s`))
(assuming your date(1) supports the %s extension)
Re:I don't think there are 31-bit architectures (Score:4, Informative)
They're actually 32-bit platforms but only are addressable by 31 bits. I believe they do arthimetic on 32 bits...
Re:Seriously, why can't we fix this damn thing now (Score:1, Informative)
Re:ObCalculation (Score:5, Informative)
date -u -d "1/1/70 `dc -e '2 30 ^p'` secs"
Sat Jan 10 13:37:04 UTC 2004
See man date
Actual figures here (in case you wanted to know) (Score:5, Informative)
FreeBSD 2.2.7 will start having this clock problem on January 18th, 2038 at 20:14 (8:14PM) EST when the unix clock on FreeBSD will read: 2147483640,
20:15 (8:15PM) EST will cause FreeBSDs clock timer to claim an invalid date... joy !
That's not 2^30 folks, that's 2^31 (2147483648) or about 8 seconds after the time I quoted above.
I know because we still have one box running 2.2.7 here (and what a fun box it is too!) can't handle more than 128megs of ram. What is this - the dark ages? that was rhetorical...
Re:How many seconds you have left: (Score:3, Informative)
Re:RTFA (Score:1, Informative)
Re:How many seconds you have left: (Score:3, Informative)
so the correct answer would be
~0.0533 years
Re:It's already happened. (Score:2, Informative)
the arithmetic? (Score:3, Informative)
It's not a billion seconds, it's 1,073,741,824 seconds -- right?
and we are close:
perl -e "print time();"
1072061932
1 365 day year is 60*60*24*365 = 31,536,000
seconds.
there are 8 leap years in there, and probably a few leap seconds, sure, but:
1,000,000,000 / 31,536,000 = 31.70979 years to hit 1 billion seconds.
1970 + 31.7 years puts us in September 2001. Randall Schwartz called this event U1E9 (unsigned 10 to the 9th power?) - there were a few glitches (mostly sorting related), but I've still got all my canned goods and batteries.
When becometh Friday the Thirteenth (Score:5, Informative)
Actually UNIX is really using an effective 31 bits because of the fact that it defaults to a signed quantity, and hence the highest order bit is really a sign bit. So when the clock finally increments 0x7FFFFFFF (19 January 2038 03:14:07) to 0x80000000 the time will wrap back to 2,147,483,648 seconds before 1970, e.g. instead of being Tuesday 19 January 2038 03:14:08, it suddenly becomes Friday the Thirteenth (specifically Friday 13 December 1901 20:45:52).
Those systems that are using an unsigned 32 bit time value can go on until Sunday 7 February 2106 06:28:15.
If we were to switch to 64 bits, we could use a resolution of nanoseconds with all that extra space and still represent time until Friday 11 April 2262 23:47:16.854775807 before the sign bit becomes an issue (and negative values can represent time back to Tuesday 21 September 1677 00:12:43.145224192).
Re:How many seconds you have left: (Score:1, Informative)
>perl -e 'print "seconds left: ", ((2**30) - time), "\n"'
seconds left: 1681182
>perl -e 'print "seconds left: ", ((2**30) - localtime), "\n"'
seconds left: 1073741824
Time is complex... (Score:5, Informative)
Firstly, every so often a leap second [wikipedia.org] is added to UTC. For this reason, over timescales of years it is impossible to exactly map unix time_t and calendar times.
Another issue is determining when a transaction happened that occurred across multiple time zones...
Re:so in other words.. (Score:2, Informative)
Re:Phew, my Newton's Safe! (Score:3, Informative)
Short version, it simplified leap-year calculations.
Re: Tag bits in integers (Score:3, Informative)
So the tag bits have to be 00 or 01 for even integers and 10 or 11 for odd integers.
Some implementations of LISP go even further, using additional bits in the non-integer case.
For example:
0 - Upper 31 bits are signed integer (even or odd).
001 - Mask to get pointer to object, 8-byte aligned.
011 - Upper 29 bits are index into cons table.
101 - Upper 29 bits are index into string table.
111 - etc.
I seem to recall that Scheme, a LISP dialect, uses this type of tortuous mechanism to extreme extent.
Not quite accurate (Score:2, Informative)
Actually, there are approximately 86,400.002 seconds in a day (see here [navy.mil]). In addition, you neglected to add the leap seconds that may or may not be required.
I'm just sayin', if you're going to try and be ultra accurate, then don't half-ass it.
Are you sure about that? (Score:4, Informative)
typedef __kernel_time_t time_t;
http://lxr.linux.no/source/include/asm-i386/posix_ types.h?v=2.0.39 [linux.no], line 21:
typedef long __kernel_time_t;
It's defined as a long for the other architectures as well. AFAIK a long is 32 bits on all platforms Linux 2.0.39 runs on.
Re:does anybody else think... (Score:3, Informative)
Think about it: a 32-bit floating point number can not possible have more different states than a 32-bit integer, yet it spans a much much larger range. It does so by sacrificing precision for large numbers.
Just try it: Output:
4000000000.000000 4.300000 4000000000.000000
With doubles (64-bit floating point numbers) this example would work: gives 4000000000.000000 4.300000 4000000004.300000
Re:ObCalculation (Score:1, Informative)
Already commercial failures on 1 billion seconds (Score:5, Informative)
This SMTP server stores the time to next retry sending a message but only the last 9 digits. So come mid 2001 Webshield would no longer retry sending a mail if the first attempt didn't work. Because it concluded it had been about 30 years since it last tried and it should give up about now.
There is a hot fix available, but this insidious problem only manifests itself if there is a problem at the receiving end so few people know they should upgrade and blame the recipient for mail that bounces immediately. Network Associates still provide software unpatched - hot fixes are only to be applied if you report he specific problem to be fixed.
If you use tempfailing [slashdot.org] (greylisting) as I do, then this immediately stuffs up any Webshield user trying to communciate with you because they will not retry after being given a temporary failure SMTP error code.
So if this example is anything to go by, then yeah, there'll be recent, modern commercial software that will fail (perhaps in non-obvious ways), with no fix available until after the event.
Re:Mod parent up (Score:2, Informative)
The workaround we have in SBCL sucks more than slightly, to be honest. What we'll probably do at some point is get the source Olsen data ourselves and parse it into a form that doesn't throw useful information away quite as freely.