linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Y2K-like bug to hit Linux computers! - Info of the day
@ 2005-05-13 11:43 Srinivas G.
  2005-05-13 11:48 ` Matthias-Christian Ott
                   ` (5 more replies)
  0 siblings, 6 replies; 29+ messages in thread
From: Srinivas G. @ 2005-05-13 11:43 UTC (permalink / raw)
  To: linux-kernel-Mailing-list

Tuesday, January 19 2038. Time: 03:14:07 GMT. If Linux programmers get
nightmares, it's about this date and time. Immediately after that second
is crossed, current computer systems running on Linux will grind to a
halt or go into a loop. This will trip up a lot of databases. No, this
is not another hoax raised by some anti-Linux lobby. It is Linux's own
Y2K nightmare, says Businessworld. 

If you ask what this 2038 bug is, you will have to put up some technical
argot. The bug has its origins in the way the C language, which has been
used to write Linux, calculates time. C uses the 'time_t' data type to
represent dates and times. ('time_t' is an integer that counts the
number of seconds since 12.00 a.m. GMT,  January 1 1970.) 

This data is stored in 32 bits, or units of memory. The first of these
bits is for the positive or negative sign, and the remaining 31 are used
to store the number. The highest number that these 31 bits can store
works out to 2147483647. 

Calculated from the start of January 1 1970, this number would represent
the 2038 time and date given at the top. Problems would arise when the
system times of computers running on Linux reach this number. They can't
go any forward and their value actually would change to -- 2147483647,
which translated to December 13 1901! That will lead many programs to
return errors or crash altogether. 

It's more damaging than the Y2K bug. That's because Y2K mostly involved
higher-level applications such as credit card payment and inventory
management. The 2038 bug, on the other hand, affects the basic
time-keeping function. 

"I would guess the biggest issue would be in the embedded field, where
software isn't changed all that often, if at all. Process controllers,
routers, mobile phones, game consoles, telecom switches and the like
would be the biggest victims," says Raju Mathur, GNU and Linux
consultant and president of the Linux Delhi Users Group. 

He, however, adds that the rate at which we are changing technology,
most systems are unlikely to use 32-bit processing by the time we get to
2038. 

But what about the present? Many applications running on Linux could
soon be making calculations for dates 30 years away -- say, for mortgage
and insurance calculations -- and could start giving out error messages
well before D-day. The problem could be widespread because more and more
corporates today are migrating to Linux because of the better security
it offers. 

"The problem is not on the radar of most people, except the techies,"
says Charles Assissi, editor, Chip magazine. 

How can the problem be sorted? Modern Linux programs could use 64-bit or
longer time_t data storage to overcome the problem. As for the existing
systems, the way the C language stores time_t data could be changed and
then all the programs could be recompiled. All this is easier said than
done. 

"There must be millions, if not billions of lines of C code floating
around that use the time_t value. Locating them, changing them, managing
programs for which source isn't available, updating embedded systems,
redeploying, is, in my opinion, an impossible task," says Mathur. Will
that be another lucrative opportunity for India's army of coders?

^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Y2K-like bug to hit Linux computers! - Info of the day
@ 2005-05-14 12:46 Matthew Geier
  2005-05-14 20:27 ` christos gentsis
  0 siblings, 1 reply; 29+ messages in thread
From: Matthew Geier @ 2005-05-14 12:46 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]


On Sat, May 14, 2005 at 10:09:04AM +0100, christos gentsis wrote:

 > BTW is there anyone that plan to use his embedded devise until 2038????
 > i would happy to see that :P any way embedded devises are there so they
 > will have sort life cycle... how long are you going to use them 6
 > months???? maximum 1-2 years....
 > so there is no any problem....

  I assume you are thinking of 'consumer' devices here, ADSL routers, 
Satelite 'Set top boxes' and the like that have short lives.

  Embeded computing is much bigger than that. I've got a 20 year old 
embedded processor controlled microwave oven. (It still knows how to 
cook better than I do :-).

  All sorts of Industrial machinery have embeded CPUs. I'm a train nut. 
In just this field, railways - equipment is expected to have a 30 year 
operational life span, and much of it is now driven by embeded 
computers, from traffic control signaling systems that have to be 
absolutely safe from 'wrong side failures', 'fly by wire' traction power 
control to regulate the trains speed, to monitoring the temprature of 
the air-conditioning. A train being built right at this very moment, 
with a 'train operating system' computer controlling every aspect of 
it's operation will probably still be in service in 2038.

  With any luck however, the people writing the software for these 
things are aware of this issue and are not blindly using signed 32 bit 
absolute time values from 1970.

  BTW, the machine i'm typing this on WONT have this problem. (Doubt 
that it will be still around in 2038 anyway). It's a 64bit platform and 
time_t is 64 bit.

  It isn't just a linux problem either, it's a generic Unix/C library 
problem. Any software system that uses a signed 32bit number from 1970 
to represent time. I have a vague recolection that there was another 
popular system around that also used signed 32bit time, only it's epoch 
is 1980. Those systems will go belly up 10 years after all the ancient 
Unix systems. :-)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3348 bytes --]

^ permalink raw reply	[flat|nested] 29+ messages in thread
[parent not found: <43GQ7-5qy-5@gated-at.bofh.it>]

end of thread, other threads:[~2005-05-16  2:10 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-13 11:43 Y2K-like bug to hit Linux computers! - Info of the day Srinivas G.
2005-05-13 11:48 ` Matthias-Christian Ott
2005-05-13 12:17 ` Richard B. Johnson
2005-05-13 16:07   ` Lee Revell
2005-05-13 12:22 ` Denis Vlasenko
2005-05-13 12:27   ` Richard B. Johnson
2005-05-13 12:43     ` Richard B. Johnson
2005-05-13 20:36       ` Bill Davidsen
2005-05-13 20:47         ` Valdis.Kletnieks
2005-05-13 21:07           ` Chris Friesen
2005-05-13 21:22             ` Valdis.Kletnieks
2005-05-13 23:10               ` David Lang
2005-05-13 21:24           ` Alan Cox
2005-05-14  9:09           ` christos gentsis
2005-05-14  9:46             ` jnf
2005-05-14 10:37               ` christos gentsis
2005-05-14 10:20             ` Willy Tarreau
2005-05-15 20:25           ` Richard B. Johnson
2005-05-13 14:37 ` DervishD
2005-05-13 15:19   ` randy_dunlap
2005-05-13 15:24     ` DervishD
2005-05-13 16:11 ` Alan Cox
2005-05-15 16:20 ` Helge Hafting
2005-05-16  2:09   ` Paul Jakma
2005-05-14 12:46 Matthew Geier
2005-05-14 20:27 ` christos gentsis
2005-05-14 21:19   ` Valdis.Kletnieks
2005-05-15  1:04     ` Gene Heskett
     [not found] <43GQ7-5qy-5@gated-at.bofh.it>
2005-05-14 13:41 ` Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).