DaemonForums  

Go Back   DaemonForums > Other Operating Systems > Other BSD and UNIX/UNIX-like

Other BSD and UNIX/UNIX-like Any other flavour of BSD or UNIX that does not have a section of its own.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 2nd April 2012
comet--berkeley comet--berkeley is offline
Real Name: Richard
Package Pilot
 
Join Date: Apr 2009
Location: California
Posts: 163
Default Y2K38 - is it still a problem?

Several years back I could not find a Linux/BSD system that was ready for the year 2038:

https://en.wikipedia.org/wiki/Year_2038_problem

Here is my simple shell script to test the problem:

Code:
#! /bin/sh
set -x
touch -t 203801181234 y2k38-test
touch -t 203801201234 y2k38-test
ls -al                y2k38-test
The code first changes the date on a file to 2038-01-18, something which still works on
32-bit systems.

Then it tries to set the date to 2038-01-20 which only works on Y2K38 compliant systems.

With time I found that some 64-bit system work but some "64-bit" systems fail.

64-bit Linux (Slackware, RedHat) and 64-bit FreeBSD systems seem to work and be Y2K38 compliant:

Code:
$ bin/y2k38.sh
+ touch -t 203801181234 y2k38-test
+ touch -t 203801201234 y2k38-test
+ ls -al y2k38-test
-rw-r--r-- 1 john doe 0 Jan 20  2038 y2k38-test
$ uname -srvm
Linux 3.2.13 #2 SMP Sat Mar 24 03:43:56 CDT 2012 x86_64
64-bit OpenBSD and 64-bit NetBSD systems do not seem to work:

Code:
$ bin/y2k38.sh
+ touch -t 203801181234 y2k38-test
+ touch -t 203801201234 y2k38-test
touch: out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]
+ ls -altr y2k38-test
-rw-r--r--  1 john doe  0 Jan 18 12:34 y2k38-test
$ uname -srvm
OpenBSD 5.0 GENERIC.MP#63 amd64
The problem with 64-bit OpenBSD and 64-bit NetBSD is probably that the default file systems are only 32-bits...

Does anyone know if OpenBSD and/or NetBSD are being changed to have a Y2K38 compliant file system for a default install?
Reply With Quote
  #2   (View Single Post)  
Old 3rd April 2012
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

See http://marc.info/?l=openbsd-tech&m=133326406409154&w=2 but please note the date
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 3rd April 2012
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 192
Default

NetBSD has switched to 64bit time_t sometime in 5-CURRENT and will be there in 6-RELEASE:

http://www.netbsd.org/changes/changes-6.0.html#time_t
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD
Reply With Quote
  #4   (View Single Post)  
Old 4th April 2012
comet--berkeley comet--berkeley is offline
Real Name: Richard
Package Pilot
 
Join Date: Apr 2009
Location: California
Posts: 163
Default

Quote:
Originally Posted by J65nko View Post
This code is pretty funny!

You know there is trouble coming with a define like this:

Code:
+#define	KERN_EMULATEMAYANPROPHESY 79	/* int: prevent the first epoch */
And I was curious to see exactly what time the clock stops:

Code:
+#define END_13BAKTUN	1356069600
as the embedded documentation is a little confusing:
Code:
 /*
+ * Wikipedia: "The current (13th) b'ak'tun will end, or be completed, on
+ * 13.0.0.0.0 (December 21, 2012 using the GMT correlation".  GMT or
+ * Mexico/General? What's 6 hours between Mayans friends.. let's follow
+ * 'Mexican time' rules.  You might get 6 more hours of reading your
+ * mail, but don't count on it.
+*/
So I ran it through the date command:
Code:
$  date -r 1356069600            # OpenBSD
$  date --date='@1356069600'     # Linux
Thu Dec 20 22:00:00 PST 2012
But I'm more concerned with
date 2147483647
when it turns
into 2147483648 ...

On Linux no problem:
Code:
$ date --date='@2147483647'
Mon Jan 18 19:14:07 PST 2038
$ date --date='@2147483648'
Mon Jan 18 19:14:08 PST 2038
On OpenBSD:
Code:
$ date -r 2147483647
Mon Jan 18 19:14:07 PST 2038
$ date -r 2147483648 
Fri Dec 13 12:45:52 PST 1901
I"m not afraid of December 20, 2012 but just thinking about the day after January 18, 2038 gives me frightful
paraskevidekatriaphobia...

Last edited by comet--berkeley; 4th April 2012 at 04:23 AM. Reason: paraskevidekatriaphobia
Reply With Quote
  #5   (View Single Post)  
Old 4th April 2012
comet--berkeley comet--berkeley is offline
Real Name: Richard
Package Pilot
 
Join Date: Apr 2009
Location: California
Posts: 163
Default

Quote:
Originally Posted by s0xxx View Post
NetBSD has switched to 64bit time_t sometime in 5-CURRENT and will be there in 6-RELEASE:

http://www.netbsd.org/changes/changes-6.0.html#time_t
Thank you!

I will give NetBSD 5-CURRENT a try.

The 5.1.2 version of NetBSD has problems similar to OpenBSD:
Code:
$ date -r 2147483647
Mon Jan 18 19:14:07 PST 2038
$ date -r 2147483648 
Fri Dec 13 12:45:52 PST 1901
Reply With Quote
  #6   (View Single Post)  
Old 4th April 2012
comet--berkeley comet--berkeley is offline
Real Name: Richard
Package Pilot
 
Join Date: Apr 2009
Location: California
Posts: 163
Default

Quote:
Originally Posted by comet--berkeley View Post
I will give NetBSD 5-CURRENT a try.
On second thought J65nko mentioned a couple of weeks ago that there is a
NetBSD 6.0 Beta available for download and it appears to be Y2K38 ready...

http://www.daemonforums.org/showthread.php?t=6944

http://www.h-online.com/open/news/it...e-1472331.html

http://blog.netbsd.org/tnf/entry/net..._beta_binaries

http://ftp.netbsd.org/pub/NetBSD/NetBSD-6.0_BETA/

I will give that a try.
Reply With Quote
  #7   (View Single Post)  
Old 5th April 2012
comet--berkeley comet--berkeley is offline
Real Name: Richard
Package Pilot
 
Join Date: Apr 2009
Location: California
Posts: 163
Thumbs up

Quote:
Originally Posted by comet--berkeley View Post
On second thought J65nko mentioned a couple of weeks ago that there is a
NetBSD 6.0 Beta available for download and it appears to be Y2K38 ready...

http://blog.netbsd.org/tnf/entry/net..._beta_binaries

http://ftp.netbsd.org/pub/NetBSD/NetBSD-6.0_BETA/

I will give that a try.
Success! NetBSD 6.0 Beta is y2k38 ready on a default install!

So Linux, FreeBSD and NetBSD are y2k38 ready.

But OpenBSD is yet to join the club....
Reply With Quote
Reply

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot problem. Geometry problem? gulanito FreeBSD Installation and Upgrading 0 3rd July 2009 03:03 AM


All times are GMT. The time now is 06:46 AM.


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