Slashdot Mirror


Time's Up: 2^30 Seconds Since 1970

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.)"

26 of 675 comments (clear)

  1. RTFA by g-to-the-o-to-the-g · · Score: 3, Informative

    The bug effects older unix systems. So if your still using UnixWare, you may be in trouble.

    1. Re:RTFA by cbiffle · · Score: 4, Informative

      Okay, I read TFA. Wrong.

      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.

    2. Re:RTFA by oGMo · · Score: 4, 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.

      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.)

      --

      Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

  2. How many seconds you have left: by dagg · · Score: 5, Informative

    perl -e 'print "seconds left: ", ((2**30) - time), "\n"'

    --
    Sex - Find It
    1. Re:How many seconds you have left: by Dahan · · Score: 4, Informative
      Isn't perl kinda big for that?

      $ echo seconds left: $(((1 << 30) - `date +%s`))

      (assuming your date(1) supports the %s extension)

  3. Re:subject by after · · Score: 3, Informative

    If this is a problem, then developers should start making ``patches'' for the year 2038.

    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 ... all I hope is that my body gets frozen so I can see that year ;)

  4. No sympathy for these guys by lurker412 · · Score: 3, Informative

    The program in question was revised in 1997. Most companies already had kicked off their Y2K programs by then. The popular press was already starting to run end of the world warnings. OK, so it wasn't a Y2K problem as such, but how this company managed to ignore the problem at that time is truly baffling.

  5. Re:Some systems... by be-fan · · Score: 4, Informative

    On many dynamically typed languages (notably Lisp) some of the bits of an integer are used as 'tag bits' that distinguish integers from pointers from cons cells, etc. Some bits are also sometimes used to help out the GC.

    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 :)

    --
    A deep unwavering belief is a sure sign you're missing something...
  6. 31 bit architecture is very common by rdunnell · · Score: 3, Informative

    in mainframes and other "big iron" in finance shops.

  7. Did the math. by Yaztromo · · Score: 4, 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.

  8. Re:I don't think there are 31-bit architectures by Anonymous Coward · · Score: 5, Informative

    Linux 2.0.x and 2.2.x use 31-bit time_t struct's.

  9. Re:I don't think there are 31-bit architectures by Tom7 · · Score: 4, Informative

    It's not uncommon to use some extra bits for tags in implementations of some high-level languages. For instance, in SML/NJ the 'int' type is 31-bits long and signed; all integers are represented shifted up one bit and with a 1 in the new ones place. This is to distinguish them from pointers, which (since they are aligned) always end in two 0 bits. The arithmetic primops account for this extra bit, usually with very little overhead since the instructions are simple and can be paired. (Other SML compilers do it in different, sometimes better ways.) Anyway, fortunately they are not dumb enough to use 'int' to represent time, so there's no problem there! I expect there are lisp implementations that do similar things.

  10. Re:I don't think there are 31-bit architectures by boa · · Score: 5, Informative

    > I could of course be wrong but I'm pretty sure there aren't 31-bit architectures. At least, these architectures are exceedingly rare if they do indeed exist.

    Of course you're wrong :-)
    The IBM OS/390 and Z/OS operating systems, which run on most IBM mainframes, are both 31-bit.

  11. yup... by AntiTuX · · Score: 4, Informative

    http://maul.deepsky.com/%7Emerovech/2038.html

    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.

  12. Re:A note about the "funnies" by lurker412 · · Score: 5, Informative
    I worked on a large Y2K program for a hospital chain. From what I observed, I can tell you this:

    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?

  13. rash of naughty dates coming by iggymanz · · Score: 5, Informative

    These might be a problem for many slashdot readers down the road, I for one plan on being likely dead, what with being old fart already. So here's those "overflow" dates, mm/dd/yyyy U.S.A. format:
    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

    1. Re:rash of naughty dates coming by Yaztromo · · Score: 4, 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.

  14. Re:Some systems... by __past__ · · Score: 4, Informative
    they'd have the sense not to override the default behaviour of the damn language, which would be to go to bignum if necessary. It would take effort to write a declaration to actually deliberately override the behaviour, and would be A Seriously Stupid Thing To Do. Doesn't mean that somebody, somewhere wouldn't do it, of course
    Indeed, someone did, sort of. Namely the implementors of the SBCL compiler (and they probably inherited it from CMUCL) who, generally, definitely do not qualify as stupid.
    "... and of course, CL transparently uses bignums when a numeric quantity exceeds the range of machine words, so we don't get overflow problems"
    * (decode-universal-time (+ (* 86400 365 50) (get-universal-time)))
    debugger invoked on condition of type TYPE-ERROR:
    The value 2635786389 is not of type (SIGNED-BYTE 32).

    This is because I didn't specify a timezone, so it asks unix for the default timezone and DST settings, and unix needs a time_t, which is 32 bits on this box.
    Dan Barlow, SBCL and the Y2038 problem

    So even if Lisp tends to not have overflow problems, Unix and C will come back and bite you if you give them a chance...
  15. This Only Hits 1 Company! Who Cares? by klausner · · Score: 3, Informative

    If you read the Cnet artlcle, this only affects software from a single company, and they are supposed to be "product lifecycle management" specialists. Why would anyone else care? The rest of us have until 2038 before there is a problem. Probably will get fixed in the 4.2 kernel.

  16. Re:I don't think there are 31-bit architectures by lkaos · · Score: 3, Informative

    The IBM OS/390 and Z/OS operating systems, which run on most IBM mainframes, are both 31-bit.

    They're actually 32-bit platforms but only are addressable by 31 bits. I believe they do arthimetic on 32 bits...

    --
    int func(int a);
    func((b += 3, b));
  17. Re:ObCalculation by Bombcar · · Score: 4, Informative

    Get the timezone right!

    date -u -d "1/1/70 `dc -e '2 30 ^p'` secs"
    Sat Jan 10 13:37:04 UTC 2004

    See man date

  18. Actual figures here (in case you wanted to know) by RouterSlayer · · Score: 5, Informative

    If you want to know what the real values are, this article and the one on cnet is wrong in so many ways... ugh, but here are the real ones that will really affect people:

    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... :)

  19. When becometh Friday the Thirteenth by Skapare · · Score: 4, 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).

    --
    now we need to go OSS in diesel cars
  20. Time is complex... by Goonie · · Score: 4, Informative
    Recording times accurately can get very complex in some cases, and longer time_t's aren't the whole solution.

    Firstly, every so often a leap second 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...

    --

    Any sufficiently advanced technology is indistinguishable from a rigged demo
    --Andy Finkel (J. Klass?)
  21. Are you sure about that? by vrt3 · · Score: 3, Informative
    http://lxr.linux.no/source/include/linux/types.h?v =2.0.39, line 57:
    typedef __kernel_time_t time_t;

    http://lxr.linux.no/source/include/asm-i386/posix_ types.h?v=2.0.39, 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.

    --
    This sig under construction. Please check back later.
  22. Already commercial failures on 1 billion seconds by waynemcdougall · · Score: 4, Informative
    Network Associate's (McAfee) Webshield product has already failed on the 1,000,000,000 second test. (In decimal - not a power of 2).

    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 (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.

    --
    Recycle PCs and build a wireless community network www.hillsborough.org.nz