This is sources Bugzilla
Bugzilla Version 2.17.5
Bugzilla Bug 2821
  mktime() returns 2147483647 for various dates > 2038 Last modified: 2006-09-09 16:56:38
     Query page      Enter new bug
Bug#: 2821   Hardware:   Reporter: William Bardwell <wbardwel@curl.com>
Host: Target: Build:
Product:     Add CC:
Component:   Version:   CC:
Remove selected CCs
Status: RESOLVED   Priority:  
Resolution: FIXED   Severity:  
Assigned To: Ulrich Drepper <drepper@redhat.com>   Target Milestone:  
Flags: Requestee:
  backport ()
  examined ()
  testsuite ()
Summary:
Keywords:

Attachment Description Type Created Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 2821 depends on: Show dependency tree
Show dependency graph
Bug 2821 blocks:

Additional Comments:


Leave as RESOLVED FIXED
Reopen bug
Mark bug as VERIFIED

View Bug Activity   |   Format For Printing


Description:   Last confirmed: 0000-00-00 00:00 Opened: 2006-06-22 21:33
#include <stdio.h>
#include <time.h>
int main()
{
struct tm t2 = { 0, 0, 0, 1, 1, 2050 - 1900, 1, 1, 1};
time_t tt2 = mktime(&t2);
printf("%ld\n");
return 0;
}

That should print -1, but instead it prints 2147483647.
Sometime in 2063 mktime() starts returning -1 as it should.

------- Additional Comment #1 From Jakub Jelinek 2006-09-08 11:21 -------
In this case diff of approx_biennia of repaired_t0 and approx_requested_biennia
is smaller than overflow_threshold (on 32-bit arches that's 21 biennia) and
so mktime_internal sets *offset to a very large value and continues rather than
returning -1 right away.  Not sure where the code should find that the current
timezone offset is not enough to undo the overflow.

------- Additional Comment #2 From Paul Eggert 2006-09-08 22:55 -------
I've fixed this in gnulib mktime.c; you can find the patch in:

http://cvs.savannah.gnu.org/viewcvs/gnulib/lib/mktime.c?root=gnulib&r1=1.53&r2=1.54

Can you please port this patch back to glibc?  Thanks.

------- Additional Comment #3 From Ulrich Drepper 2006-09-09 16:56 -------
I added the patch to cvs.

     Query page      Enter new bug
Actions: New | Query | bug # | Reports | Requests   New Account | Log In