--- Begin Message ---
Subject: |
test-parse-datetime regression test failure with glibc-2.16.0 |
Date: |
Wed, 15 Aug 2012 14:56:16 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120628 Firefox/13.0.1 SeaMonkey/2.10.1 |
The test-parse-datetime fails with glibc-2.16.0 The new glibc uses time
data from http://www.iana.org/time-zones. This currently uses a
leapseconds cumulative value of 24.
The problem shows up in the test-parse-datetime.c file:
time_t ref_time = 1304250918;
gmtoff = gmt_offset (ref_time);
p = "2011-05-01T11:55:18";
expected.tv_sec = ref_time - gmtoff;
expected.tv_nsec = 0;
ASSERT (parse_datetime (&result, p, 0));
ASSERT (expected.tv_sec == result.tv_sec &&
expected.tv_nsec == result.tv_nsec);
All the ISO 8601 test differ by leapseconds:
string '2011-05-01T11:55:18' diff -24 0
string '2011-05-01T11:55:18' diff 24 0
string '2011-05-01 11:55:18' diff 24 0
string '2011-05-01T11:55:18Z' diff 24 0
string '2011-05-01 11:55:18Z' diff 24 0
string '2011-05-01T11:55:18-07:00' diff 24 0
string '2011-05-01 11:55:18-07:00' diff 24 0
string '2011-05-01T11:55:18-07' diff 24 0
string '2011-05-01 11:55:18-07' diff 24 0
I'm not sure if this is a coreutils or gnulib problem, but it shows up
in the coreutils regression test.
-- Bruce Dubbs
linuxfromscratch.org
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#12206: test-parse-datetime regression test failure with glibc-2.16.0 |
Date: |
Fri, 17 Aug 2012 11:15:31 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 |
On 08/17/2012 10:46 AM, Bruce Dubbs wrote:
> I've never seen the M parameters in TZ before. What do they do?
They specify the time zone rules directly, without consulting
the tz database. Unlike the tz database, they're specified by
POSIX, so they should be more portable. Also, POSIX says they
ignore leap seconds so they should not have a leap second glitch.
I suspect you've found a glibc bug in its handling of tm_gmtoff
and/or localtime-vs-gmtime when leap seconds are enabled,
which you're welcome to report.
This code is supposed to be testing parse-datetime, not
for glibc bugs, so I pushed the following patch into gnulib
and am marking this as done. The fix should be propagated into
coreutils the next time it syncs from gnulib.
test-parse-datetime: avoid glibc leap-second glitch
* tests/test-parse-datetime.c (main): Set TZ to US Eastern time
with the 2012 rules. Problem reported by Bruce Dubbs in
<http://bugs.gnu.org/12206>.
diff --git a/tests/test-parse-datetime.c b/tests/test-parse-datetime.c
index 1c9fd2d..98ce64b 100644
--- a/tests/test-parse-datetime.c
+++ b/tests/test-parse-datetime.c
@@ -123,6 +123,12 @@ main (int argc _GL_UNUSED, char **argv)
set_program_name (argv[0]);
+ /* Set the time zone to US Eastern time with the 2012 rules. This
+ should disable any leap second support. Otherwise, there will be
+ a problem with glibc on sites that default to leap seconds; see
+ <http://bugs.gnu.org/12206>. */
+ setenv ("TZ", "EST5EDT,M3.2.0,M11.1.0", 1);
+
gmtoff = gmt_offset (ref_time);
--- End Message ---