Bug 117821 - y2038 bugs in gmtime, localtime
y2038 bugs in gmtime, localtime
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
rawhide
i586 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-08 17:58 EST by John G. Myers
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-03-22 12:38:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test case (447 bytes, text/plain)
2004-03-08 17:58 EST, John G. Myers
no flags Details

  None (edit)
Description John G. Myers 2004-03-08 17:58:15 EST
Description of problem:

gmtime and localtime produce incorrect output for time values after
January 19, 2038 03:14:07 GMT.

Version-Release number of selected component (if applicable):

glibc-2.3.2-101

How reproducible:

Run the attached test program.

Steps to Reproduce:
1.
2.
3.
  
Actual results:

time = 2038-01-19 03:14:07
time = 2038-01-18 19:14:07
time = 1901-12-13 20:45:52
time = 1901-12-13 12:45:52

Expected results:

time = 2038-01-19 03:14:07
time = 2038-01-18 19:14:07
time = 2038-01-19 03:14:08
time = 2038-01-18 19:14:08

Additional info:
Comment 1 John G. Myers 2004-03-08 17:58:55 EST
Created attachment 98387 [details]
Test case
Comment 2 Jakub Jelinek 2004-03-09 08:59:59 EST
This is a WONTFIX for 32-bit arches, sorry, but I don't think there
will be many 32-bit arches out there in 34 years from now.
[jakub@hammer obj]$ ./test
time = 2038-01-19 03:14:07
time = 2038-01-19 04:14:07
time = 2038-01-19 03:14:08
time = 2038-01-19 04:14:08
works just fine.  With the advent of AMD64 and IA32e I think most of
the computers out there will be 64-bit already within at most 5 years.
If 32-bit platforms are still around in big enough quantities in
2030, this can be certainly reconsidered, but until then it is just
a waste of time.
Comment 3 John G. Myers 2004-03-09 13:46:45 EST
There are things, such as CA certificates, mortgage amoritizations,
etc. that need to deal with dates 35 or more years into the future.

I wouldn't have filed the bug if I hadn't encountered it.  It prevents
openssl from being able to create a cert with a liftime past 2038.
Comment 4 Jakub Jelinek 2004-03-22 12:38:57 EST
Then openssl needs to use its own timekeeping, it is as simple as that.
gmtime/localtime is not an API to work with any time in the history/future.
It will not handle pre-1900 dates either and similarly to this, applications
which need to work with such dates need to handle it on their own.

Note You need to log in before you can comment on or make changes to this bug.