Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 The 2038 Syndrome: Second Coming of Y2K
Index -> Programming, C -> C Help
Goto page 1, 2, 3, 4  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
randint




PostPosted: Fri Apr 19, 2013 5:33 pm   Post subject: The 2038 Syndrome: Second Coming of Y2K

So, I read about the 2038 syndrome, which manifests itself as the inability of a computer system to tell time after January 19, 2038, at 03:14:07 AM, UTC. Here is a diagnostic test:
c:

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>
int main()
{
    time_t t;
       t = (time_t) 1000000000;
       printf ("%d, %s", (long) t, asctime (gmtime (&t)));
       t = (time_t) (0x7FFFFFFF);
       printf ("%d, %s", (long) t, asctime (gmtime (&t)));
       t++;
       printf ("%d, %s", (long) t, asctime (gmtime (&t)));

    return 0;
}


I do not understand why it compiles with an error (i.e. it runs but then pops up with an error)...could my computer have been tested positive for this syndrome?
Sponsor
Sponsor
Sponsor
sponsor
Nathan4102




PostPosted: Fri Apr 19, 2013 5:45 pm   Post subject: RE:The 2038 Syndrome: Second Coming of Y2K

The 2038 "crisis" isn't so much of a syndrome, and you don't really need to test to see if your computer will be affected. Any 32 bit computer won't be able to tell the date after January 19, 2038 because that date is based on the number of seconds since the 1'st of January, 1970. On January 19 2038, the number of seconds will reach the 32 bit integer limit, and wrap back to 0.

I wouldn't worry about it, by 2038, 32 bit computers will be non-existent, or at least rarely used, since 64+ bit will be used in most homes. Also, computers that use different methods for telling time wouldn't be affected. The "Seconds since Jan. 1, 1970" thing though is used in the majority of home computers.
mirhagk




PostPosted: Fri Apr 19, 2013 7:33 pm   Post subject: RE:The 2038 Syndrome: Second Coming of Y2K

Except it's already manifesting itself. For instance I know a server set a default time-out to a ridiculous value in the future (it was like 1 million), which caused problems back in 2006, since the timeout value wrapped around and everything was passed the timeout date.

And also all consumer computers should be 64 bit then (by the way notice how long it's already taken, I wouldn't be so quick to automatically assume). I know microcontrollers and embedded systems might not be 64 bit by then, especially in systems that are old (imagine a car 20 years old in 2038, and it was made just 5 years in the future). It could definitely be a problem for certain systems.
randint




PostPosted: Fri Apr 19, 2013 8:16 pm   Post subject: Re: The 2038 Syndrome: Second Coming of Y2K

In other words, you claim that all 64-bit computers will not be affected? If so, I do not need to worry, as I will buy a 64-bit computer in 2 months. Also, I think that the corporate world is going to stick to 32-bit for some time. You see, I am going to use as many 64-bit applications as possible.
btiffin




PostPosted: Fri Apr 19, 2013 8:24 pm   Post subject: Re: The 2038 Syndrome: Second Coming of Y2K

y2k was a cake walk compared to the embedded nature of the epoch problem. Human nature to shorten dates to two digits was a visible issue. The zero rollover will go unseen, the consequences, not so much. The problem won't go away by attrition, it'll be a concerted effort, left till the last minute.

Everyone here has 25 years to build up a little expertise in epoch mitigation. Believe me, 2036 will be a lucrative year for C programmers, then by 2038 the monied people of the earth will be all ticked off at nerds again, and a 2000 dotcom style bust will follow, and 2040 will be a crap year for all programming. Or, politicians will do away with that pesky fiduciary responsibility thing, and the steel mills, hydro grids and elevators will be on their own, to fail safe or not.

Cheers

(And by the way, look at some cheques, 2 digit years already, we learn nothing)
md




PostPosted: Fri Apr 19, 2013 8:47 pm   Post subject: RE:The 2038 Syndrome: Second Coming of Y2K

Time problems are more annoying then you'd think: consider the case of a 25 year loan being made next year and you'll see why.
Nathan4102




PostPosted: Fri Apr 19, 2013 8:50 pm   Post subject: RE:The 2038 Syndrome: Second Coming of Y2K

As consumers though, or customers to the bank, would we really have anything to worry about? Obviously the bank's would remember the consequences of Y2K, and switch to 64 bit systems or some other integer-overflow prevention system before the date. And if they don't, they'd have to correct everything or lose customers.
randint




PostPosted: Fri Apr 19, 2013 9:19 pm   Post subject: Re: The 2038 Syndrome: Second Coming of Y2K

The problem here [for 2038] is that it is far more difficult to raise awareness about 2038 than Y2K, due to the lack of mathematical knowledge among the public.

I think that the concept is very simple--it traces back to the Pascal's triangle, and the sum of any given row of the Pascal's triangle.

The idea is, let r denote the row number of a positive integer, and S(r) denote the sum of this row of the Pascal's triangle, then S(r)=2^r, where "^" is "to the power of". But a division by 2 is necessary, as integers are allowed to be either positive or negative. a -1 is necessary as 0 takes a bit.

So, from a mathematical perspective, there are 2 functions that would denote the maximum value and minimum value of an integer, respectively, given the number of bits:

max_int (bit) = 2^(bit - 1) - 1
min_int (bit) = -2^(bit - 1)

Where the variable "bit" represents a positive integer, and the above ranges are inclusive, [e.g. if (bit = 32), then an integer can go from -2147483648 to 2147483647.
Sponsor
Sponsor
Sponsor
sponsor
Sly14Cat




PostPosted: Sat Apr 20, 2013 6:46 am   Post subject: RE:The 2038 Syndrome: Second Coming of Y2K

Therefore.....
mirhagk




PostPosted: Sat Apr 20, 2013 7:31 am   Post subject: RE:The 2038 Syndrome: Second Coming of Y2K

md points out, the problem will manifest itself much sooner than a lot of people realize.

A 25 year loan taken out next year would break the 32 bit barrier. Hopefully the bank has upgraded, but the last time I was at any non-compsci business, they were all still using XP at the latest.
randint




PostPosted: Sat Apr 20, 2013 9:36 am   Post subject: Re: The 2038 Syndrome: Second Coming of Y2K

mirhagk, it is not about Windows XP, Vista, 7 or 8. The problem is whether or not the system, and all programs running under it, are 64 bit. The corporate enironment is very resistant to change. One of the technicians I talked to (who works for the York Region District School Board) claims that "all board computers will be upgraded from Windows XP 32 bit to Windows 7 32 bit in the Fall of 2013". You see, the problem will still exist if 32 bit is used. For me, my home laptop (which was purchased 2 years ago) is 64 bit Windows 7. I will buy a laptop soon, and it will be 64 bit as well, seeing that this is now the new standard for computers.
mirhagk




PostPosted: Sat Apr 20, 2013 11:52 am   Post subject: RE:The 2038 Syndrome: Second Coming of Y2K

My point is that systems don't change very often. XP is what, 12 years old now, and the majority of businesses/schools are still using it. Plus they are using the 32 bit version. Also XP is the earliest windows system that has a 64 bit option, and that was added after the fact.

Last time I was in the bank (a few weeks ago), the agent was using what looked like windows 98. I severely hope it was just a classic UI, but who knows. I know my mom's 2nd job required her to do medical billing, and she was using pre-95 up until last year. That's 25 years, which means 32 bit machines today might still be use in 2038.

As for the school board, it sounds like they'll upgrade next when windows 10 comes out (to windows 9). Fortunately .NET software does not suffer from the same problem, as it abstracts time into an object, stores ticks as a 64 bit variable (which could easily be changed without requiring recompiling) and things like milliseconds are floating point values, and storing time is done as a string. I think switching consumers to 64 bit should be hopefully done pretty soon, I wouldn't be surprised if windows 9 dropped 32 bit support altogether. Soon 64-bit applications might actually start being released (currently most software is still just 32 bit, which makes me mad for things like games which could use the extra 4 GB I have on my machine)
randint




PostPosted: Sat Apr 20, 2013 7:28 pm   Post subject: Re: The 2038 Syndrome: Second Coming of Y2K

There are still major problems that will hinder us from curing this fatal syndrome, namely, the lack of 64 bit applications. Again, as simple as it sounds, a 64-bit version of VLC Media Player is only in the development (beta testing) stage. By the way, Visual Studio 2012 does not have any 64 bit version whatsoever. These things need to be fixed, as 32 bit will become outdated and unreliable.

I do not understand this: why was it so easy for the corporations to switch from 16-bit to 32-bit in the 1990s, when it is almost impossible to switch from 32-bit to 64-bit in the 2010s? This does not make sense...maybe because the economy is in **** right now.
btiffin




PostPosted: Sun Apr 21, 2013 12:39 am   Post subject: Re: The 2038 Syndrome: Second Coming of Y2K

Don't worry about banks. Banks will pony any and all monies needed to avoid fiduciary responsibility risk.

Worry about small embedded chips controlling pressure valves in the manure pile plant. The manure guy doesn't have other people's money to throw at virtual problems, so, these are the places that the epoch problem may be most felt.

Y2K was pretty much a big business issue. Manure pile pressure valves wouldn't have cared two noogies about human formatted date strings, or if they were wrong, as internal timers don't usually speak in human formts. 2 digit dates are a human, and a visible problem. Epoch rollover is non-obvious, even for people that are "watching".

Big business will get past the epoch, with a little moaning afterwards (moaning which will lead to removal of software development fun money, just like after y2k bills came in). Midsized enterprise may not have those resources, let alone an inventory of what chips might still be running 4 bytes of seconds come 2038, or which of these chips will fail dangerous when time jumps backwards almost 70 years from one second to the next.

But, humans are led by people that want to survive too (while building up the stacks of cash), so stuff will happen. I expect a panic, well paid C grunts for a while, a fizzle and very few explosions, if any. I'd like to see less panic, but that'd be asking humans to look further ahead than next quarter.

Cheers
mirhagk




PostPosted: Sun Apr 21, 2013 7:38 am   Post subject: RE:The 2038 Syndrome: Second Coming of Y2K

It won't be 70 years though, it'll be 140, because it'll go negative 70 years.
Display posts from previous:   
   Index -> Programming, C -> C Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 4  [ 49 Posts ]
Goto page 1, 2, 3, 4  Next
Jump to:   


Style:  
Search: