This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A patch for mktime.c and tz*.c.


   From: Ulrich Drepper <drepper@cygnus.com>
   Date: 07 Nov 1998 23:00:30 -0800

   hjl@lucon.org (H.J. Lu) writes:

   > Have you tried my version on the Plumhall C testsuite? My version
   > also works with the POSIX test suite.

   [Please note that I must not even tell you what the test is doing.
   Stupid license.]

That might make it difficult for the rest of us to understand any
changes that you make to pass the test.  Sigh.  I suppose we'll have
to reengineer the test cases from your changes.

Perhaps the Plumhall suite is using unreasonably small DST regions
(e.g. DST in effect for only one day), which 2.0.100 won't handle in
the way that Plumhall desires.  This can easily be fixed by changing
the constants 7889238 and 3 (two instances) in 2.0.100 to some other
values, at the cost of making the code a bit slower in the troublesome
cases.

I must reiterate that hjl's patch causes problems if the Olson tables
are being used.  E.g. it assumes either a constant 1-hour or a
constant 30-minute DST offset for New Zealand, and both assumptions
are incorrect.

The basic idea behind hjl's patch is correct.  It's true that glibc
knows the information that he is trying to have mktime obtain.  But
the method used in the patch can't possibly work in general, and will
break more real-world test cases than the 2.0.100 method breaks.

   From: Ulrich Drepper <drepper@cygnus.com>
   Date: 07 Nov 1998 21:59:29 -0800

   Paul Eggert <eggert@twinsun.com> writes:

   > I'm not sure it's worth your and our time to pursue this further, as
   > the bug does not seem to occur in 2.0.100.

   Well, the changed version passes now the POSIX test suite (according
   to HJ) but it now fails the Plumhall C testsuite.  Which does not mean
   the later has no bugs.

Just in case this isn't clear already: the change to mktime.c (from
2.0.99 to 2.0.100) was unnecessary from a standards-conforming point
of view.  The POSIX test suite is buggy: it assumes that when tm_isdst
is out of range for the rest of the broken-down time, then the rest of
the broken-down time must be adjusted, not tm_isdst.  But this
requirement cannot be deduced from the C and POSIX standards.

It doesn't hurt that glibc 2.0.100 mktime passes the POSIX test suite,
even the buggy parts, but it's obviously not required.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]