2038 unix bug

TaNgO tango en lugmen.org.ar
Lun Mayo 2 18:09:28 ART 2005


conan wrote:
> Alejandro o el que tenga máquina de 64 mordidas: qué les dice este script a
> ustedes?
> ===================
> #!/usr/bin/perl
> #
> # I've seen a few versions of this algorithm
> # online, I don't know who to credit. I assume
> # this code to by GPL unless proven otherwise.
> # Comments provided by William Porquet, February 2004.
> # You may need to change the line above to
> # reflect the location of your Perl binary
> # (e.g. "#!/usr/local/bin/perl").
> # Also change this file's name to '2038.pl'.
> # Don't forget to make this file +x with "chmod".
> # On Linux, you can run this from a command line like this:
> # ./2038.pl
> use POSIX;
> # Use POSIX (Portable Operating System Interface),
> # a set of standard operating system interfaces.
> $ENV{'TZ'} = "GMT";
> # Set the Time Zone to GMT (Greenwich Mean Time) for date calculations.
> for ($clock = 2147483641; $clock < 2147483651; $clock++)
> {
>     print ctime($clock);
> 	}
> 	# Count up in seconds of Epoch time just before and after the critical
> 	# event.
> 	# Print out the corresponding date in Gregorian calendar for each result.
> 	# Are the date and time outputs correct after the critical event second?
> ===================
> A mi me da:
> $ 2038bug.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 -> CUAC!
> Fri Dec 13 20:45:52 1901
> Fri Dec 13 20:45:52 1901
> 
Salida de SPARC Station 5, con debian.

tango en artec01:~$ uname -a
Linux artec01.artec 2.4.27-tgo01 #6 Thu Feb 24 17:02:11 ART 2005 sparc 
GNU/Linux
tango en artec01:~$ cat /proc/cpuinfo
cpu             : Fujitsu TurboSparc MB86907
fpu             : reserved
promlib         : Version 3 Revision 2
prom            : 2.29
type            : sun4m
ncpus probed    : 1
ncpus active    : 1
BogoMips        : 169.57
MMU type        : Fujitsu TurboSparc
contexts        : 256
nocache total   : 2097152
nocache used    : 378624

tango en artec01:~$ ./clock.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
Tue Jan 19 03:14:07 2038 -> CUAC!
Tue Jan 19 03:14:07 2038
Tue Jan 19 03:14:07 2038

salida en Ultra SPARC Station 1. Solaris 9

tango en sun1:~$ uname -X
System = SunOS
Node = sun1
Release = 5.9
KernelID = Generic_117171-12
Machine = sun4u
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 1

tango en sun1:~$ ./clock.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
Tue Jan 19 03:14:07 2038 -> CUAC!
Tue Jan 19 03:14:07 2038
Tue Jan 19 03:14:07 2038

Creo que esta funcionando con kernel de 32 bits. En cuanto la haga andar 
  con 64 bits paso la salida del comando.

Alguien puede mostrar la salida de este comando en otras plataformas 
pero que usen Unix? HP-UX, AIX, SCO, BSD, FreeBSD, etc.

salu2

-- 

------------------------------------------------
TaNgO - Mendoza (San Rafael)
Usuario Linux Registrado #270014
JID..: TaNgO en lugmen.org.ar
UIN: 41100189
msn, yahoo: mhdion



Más información sobre la lista de distribución lug-list