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

7 of 675 comments (clear)

  1. I don't think there are 31-bit architectures by lkaos · · Score: 4, Insightful

    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.

    What I believe this article is referring to is that some software may have been coded to use a bit in integers to store extra info. This seems like a pretty bad idea though as it would have all sorts of interesting effects on overflow and such. It would seem like it would only be useful to a very very very tiny portion of software since the overhead in using this method as a general purpose solution would be terribly difficult.

    Sounds like it's just the story of yet another software bug...

    --
    int func(int a);
    func((b += 3, b));
  2. Re:Some systems... by Anonymous Coward · · Score: 5, Insightful

    Well, they wouldn't just have the sense to use a bignum - 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, but it wouldn't be the "common case" that there would be a problem waiting to happen, like in C.

  3. Seriously, why can't we fix this damn thing now? by Anonymous Coward · · Score: 5, Insightful

    Seriously, could we please get started fixing this 2038 bug now? I don't know if it's practical to change time_t to "long long"; if not, could we at least officially define the successor to time_t?

    I know that the emergence of 64-bit chips will alleviate this somewhat, but it wouldn't surprise me if at least embedded systems are still running 32-bits in 2038.

    I know that "long long" is common, but it's not part of the official C++ standard yet. Shouldn't we be putting this in the standard now? It's not too much to require language libraries to have 64-bit integer support (if necessary). This doesn't have to be painful.

    I'll feel a lot better the day that I know what I'm officially supposed to use instead of time_t -- or if I can be given a guarantee that time_t will be upgraded to 64 bits within the next few years.

  4. Re:Prepare for the Y10K Bug! by Mr.+Slippery · · Score: 5, Insightful
    Be smart, and play it safe. Use a 5, or better yet, 10 digit year. What's a few bytes?
    I wrote the following in the RISKS forum a few years ago:
    So maybe I'm an April Fool, but it seems to me that the Y10K issue is worth a little serious thought.

    There are areas of human endeavor in which 8000 years is not an extreme time span. At present, we deal with these long time spans only in modeling things like geological and cosmological events. But it is not unreasonable that within the next century, we may begin to build very high technology systems with mission durations of thousands of years - for example, a system to contain radioactive wastes, or a probe to another star system.

    Y2K issues have raised our consciousness about timer overflows, but it's quite possible that this may fade in succeeding generations. There's no reason not to start setting standards now.

    Perhaps all time counters should be bignums?

    --
    Tom Swiss | the infamous tms | my blog
    You cannot wash away blood with blood
  5. Re:A note about the "funnies" by Kenja · · Score: 3, Insightful

    This is true of IT work in general. If you do your job, nothing happens and people think you're wsting time.

    --

    "Have you ever thought about just turning off the TV, sitting down with your kids, and hitting them?"
  6. Embedded systems by tepples · · Score: 3, Insightful

    Perhaps all time counters should be bignums?

    Bad idea. A "system to contain radioactive wastes" will usually be an embedded system with a fixed memory. Fixed-memory machines need fixed-size data structures, and a 64-bit count of seconds should hold even over lifetime-of-the-Universe or lifetime-of-copyright time scales.

  7. Re:does anybody else think... by be-fan · · Score: 3, Insightful

    Argh! God I hate XML culture! How is this in any way better than a 64-bit integer???

    --
    A deep unwavering belief is a sure sign you're missing something...