DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 27th March 2009
diw's Avatar
diw diw is offline
Port Guard
 
Join Date: Jul 2008
Posts: 45
Thanked 2 Times in 2 Posts
Talking 2038.

Hiya.

Remember Y2K?
Apparently POSIX has something better in store.

It's probably not news to a programmer but I found it interesting.

http://en.wikipedia.org/wiki/Year_2038_problem
http://www.2038bug.com/

Quote:
Originally Posted by http://www.2038bug.com/
Modern computers use a standard 4 byte integer for this second count. This is 31 bits, storing a maximum value of 2³¹. The remaining bit is the sign. This means that when the second count reaches 2147483647, it will wrap to -2147483648.
Look there's even a counter (well, more of simulation):


I particularly like the FAQ page:
http://www.2038bug.com/faq.html

Time to buy more tinfoil.

Best wishes.

Last edited by diw; 27th March 2009 at 03:10 PM. Reason: Fixed superscript - 2³¹.
Reply With Quote
  #2   (View Single Post)  
Old 27th March 2009
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Thanked 49 Times in 43 Posts
Default

No sweat, by 2038 we will all have moved to 64bit m/c's...even your toaster will probably have a 64 microprocessor. :-)
Reply With Quote
  #3   (View Single Post)  
Old 27th March 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

This is a well know problem, I suspect anyone using Unix for more then a year knows of it.

I suspect that when the decision was made to use a signed 32-bit integer for time_t, larger types were either unavailable or inefficient..

These days, some systems are switching to a signed 64-bit integer.. using an unsigned 32-bit integer would have caused considerable compatibility issues, like the inability to express time before the Unix epoch.

OpenBSD still uses a signed 32-bit integer, which really won't be a problem.. they still have ~29 years until it'll be worth fixing.

It just goes to show that the developers of Unix never expected people would be using it decades later.. 2038 in the 1970's is like, flying cars and aliens with super computers the size of a freckle.

I'm not worried about this problem yet, I don't create any cron/at jobs that far into the future.. and, my pocket schedule isn't that well planned out.

Take care.
Reply With Quote
  #4   (View Single Post)  
Old 27th March 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Note; the designers of POSIX.1-2008 didn't address this issue either.. they simply state that time_t and clock_t shall be integer or real-floating types.

With operating systems like OpenBSD, 3rd party packages aren't usually in the wild.. when the change to a 64-bit time_t occurs, it won't be much of a problem.. for some things it'll be as simple as recompiling, others may only be slightly more involved.
Reply With Quote
  #5   (View Single Post)  
Old 27th March 2009
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Thanked 49 Times in 43 Posts
Default

Come to think of it, will we still be running Unix in 2038? I hope not. :P
Reply With Quote
  #6   (View Single Post)  
Old 27th March 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Quote:
Originally Posted by ephemera View Post
Come to think of it, will we still be running Unix in 2038? I hope not. :P
Is it sad that I hope we still are?
Reply With Quote
  #7   (View Single Post)  
Old 27th March 2009
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Hmm, I always thought what happened on integer overflow was purely a hardware dependent thing. (which I always hoped rolls over or segfaults on the majority of architectures lol)


Quote:
Originally Posted by BSDfan666 View Post
I suspect that when the decision was made to use a signed 32-bit integer for time_t, larger types were either unavailable or inefficient..
I would reckon at the time, 32-bit integers would have been like picking a 64-bit integer today: be happy if you have it available, but don't bet on it to be a chorts.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.

Last edited by TerryP; 27th March 2009 at 07:50 PM.
Reply With Quote
  #8   (View Single Post)  
Old 27th March 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,834
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by ephemera View Post
Come to think of it, will we still be running Unix in 2038? I hope not. :P
Maybe we will, but it will be the Unix of 2038 & not the Unix of today.

The BSD's have evolved from being just a set of patches to AT&T's version(s) to a splintered assortment of open source projects which address the needs of those developing/extending them & their surrounding user communities. There is nothing stated that these operating systems will not continue to evolve as needs change & new technologies arise. In fact, the developers within the *BSD communities seem energized to adapt the source base to new problems/needs/technologies.

What can be said with certainty is if the community does not continue to adapt, we won't be running Unix in 2038.
Reply With Quote
  #9   (View Single Post)  
Old 27th March 2009
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Thanked 49 Times in 43 Posts
Default

Quote:
Originally Posted by BSDfan666 View Post
Is it sad that I hope we still are?
To be fair I would like to see Windows die too.
I hope they achieve their landmark billion'th line of code and then the whole thing crumbles under it's own weight.

But TBH, I think neither of that is likely. Microsoft Windows will probably be around; I am sure they will figure out a way to keep the Windows cash cow alive.
As for Unix, even if it were be lose it's current popularity there will certainly be a SIG that will keep it alive, hey after all the code is open-source.

Personally, I think I might still be using Unix 3 decades later. But, who knows maybe quantum computers might become a reality by that time.

Last edited by ephemera; 27th March 2009 at 09:07 PM.
Reply With Quote
Old 27th March 2009
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Thanked 49 Times in 43 Posts
Default

Quote:
Originally Posted by ocicat View Post
Maybe we will, but it will be the Unix of 2038 & not the Unix of today...What can be said with certainty is if the community does not continue to adapt, we won't be running Unix in 2038.
Yup, I share your view.

Last edited by ephemera; 27th March 2009 at 08:32 PM.
Reply With Quote
Old 28th March 2009
diw's Avatar
diw diw is offline
Port Guard
 
Join Date: Jul 2008
Posts: 45
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by BSDfan666 View Post
Is it sad that I hope we still are?
Of course not.
As long as we can still run without X how bad could it be?

It is sad that the hardware doesn't age like cool bikes and cars.
Everybody cranes their heads when a World War II vintage Harley Davidson goes putt putting down the road on a quiet saturday afternoon.

It would be so nice for old 386s to be like that 20 years from now.
"Ooh. Look. No fan!"
"Yes. That's a genuine SGI sonny. Ahh. When I was a lad ..."

I suppose that's the main reason that support for older architectures can be eventually dropped - attrition finally gets the most diehard machines.

As long as the BSDs keep moving with the hardware (no matter how hard it is ) we should be fine.

Best wishes.
Reply With Quote
Old 28th March 2009
diw's Avatar
diw diw is offline
Port Guard
 
Join Date: Jul 2008
Posts: 45
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by ephemera View Post
Microsoft Windows will probably be around; I am sure they will figure out a way to keep the Windows cash cow alive.
I suspect you are right. After all it's one area where they have shown a desire to achieve.
Perhaps they will become like one of those large corporations that used to be big in some other unrelated industry that nobody knows about. A move from software to cosmetics sounds okay.

Best wishes.
Reply With Quote
Old 28th March 2009
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Reading about porting NetBSD to a quantum computer ought to be interesting someday, if any of us are still alive.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 28th March 2009
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 358
Thanked 9 Times in 8 Posts
Default

About 3 years ago, I had said that Microsoft would not matter anymore in 5-10 years. Not saying they would be out of business. I meant programs would be written where MS would not be the goto company as to how things would work. Since then, Paul Graham and Wired both wrote articles saying the same thing. (I'm a genius!)

With the decline of Internet Explorer and all the "cloud computing" talk, along with the rise of Google, and even Amazon and others in this area, I stand by that statement. I do believe Unix and its variants will still be standing in 2038 but, of course, with all the improvements one would expect. It will be the machine that keeps on ticking and the preferred platform for all things.
Reply With Quote
Old 28th March 2009
diw's Avatar
diw diw is offline
Port Guard
 
Join Date: Jul 2008
Posts: 45
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by drhowarddrfine View Post
About 3 years ago, I had said that Microsoft would not matter anymore in 5-10 years.
Haha. Me too. I am a genius also. :]
I figured Apple would rise and rise ...
Unfortunately they seem to be too expensive for many.

Please try the batch file in your Windows print thread.
The suspense is killing me.

Best wishes.
Reply With Quote
Old 29th March 2009
drhowarddrfine drhowarddrfine is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 358
Thanked 9 Times in 8 Posts
Default

Quote:
Originally Posted by diw View Post
Please try the batch file in your Windows print thread.
I didn't see your post over there. I'll make my comments there.
Reply With Quote
Old 31st March 2009
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

By 2038 we'll probably already be moving beyond 64-bit.
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
Old 31st March 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Quote:
Originally Posted by JMJ_coder View Post
By 2038 we'll probably already be moving beyond 64-bit.
Really? Why? I seriously doubt we'll need systems with >= 16384 Petabytes of memory.

There was an article about this somewhere, but.. 128-bit is probably the end of the line.
Reply With Quote
Old 31st March 2009
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default

Quote:
Originally Posted by BSDfan666 View Post
Really? Why? I seriously doubt we'll need systems with >= 16384 Petabytes of memory.

There was an article about this somewhere, but.. 128-bit is probably the end of the line.
And I remember 20 years ago when the salesman told us that a 10 MB hard drive would be more space than anyone would ever need.

Time will tell.
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
Old 31st March 2009
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 534
Thanked 14 Times in 13 Posts
Default

Quote:
Microsoft Windows will probably be around
Will Microsoft have invented Unix by 2038 (much as they invented the Internet and the web browser) ?
Reply With Quote
Reply

Tags
2038, unix millenium bug, y2k38

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:12 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick