Donate Share

curl and libcurl

Tracker: Bugs

3 self test failures in TAI timezones - ID: 1745964
Last Update: Comment added ( dfandrich )

as reported by Rickard Närström in
https://bugs.gentoo.org/show_bug.cgi?id=183716:

$ TZ=right/Europe/Stockholm ./runtests.pl -a -k 31 46 61 506 517
********* System characteristics ********
* curl 7.16.3 (x86_64-pc-linux-gnu)
* libcurl/7.16.3 OpenSSL/0.9.8d zlib/1.2.3 libidn/0.6.5
* Features: IDN Largefile NTLM SSL libz
* Host: passivegrunt
* System: Linux passivegrunt 2.6.21-gentoo #1 SMP Sun May 27 21:57:49 EST
2007 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ AuthenticAMD
GNU/Linux
* Server SSL: ON
* libcurl SSL: ON
* libcurl debug: OFF
* valgrind: OFF
* HTTP IPv6 OFF
* FTP IPv6 OFF
* HTTP port: 8990
* FTP port: 8992
* FTP port 2: 8995
* FTPS port: 8993
* HTTPS port: 8991
* TFTP port: 8997
* SCP/SFTP port: 8999
* SOCKS port: 9000
* SSL library: OpenSSL
* Libtool lib: ON
*****************************************
test 031...[HTTP with weirdly formatted cookies and cookiejar storage]

output FAILED:
--- log/check-expected 2007-07-01 10:39:25.000000000 +0200
+++ log/check-generated 2007-07-01 10:39:25.000000000 +0200
@@ -4,4 +4,4 @@

.127.0.0.1 TRUE /silly/ FALSE 0 ismatch this
.127.0.0.1 TRUE / FALSE 0 partmatch present
-127.0.0.1 FALSE /we/want/ FALSE 2054030187 nodomain
value
+127.0.0.1 FALSE /we/want/ FALSE 2054030210 nodomain
value
test 046...[HTTP, get cookies and store in cookie jar]

output FAILED:
--- log/check-expected 2007-07-01 10:39:25.000000000 +0200
+++ log/check-generated 2007-07-01 10:39:25.000000000 +0200
@@ -6,7 +6,7 @@
www.loser.com FALSE / FALSE 1139150993 UID 99
127.0.0.1 FALSE / FALSE 1439150993 mooo indeed
127.0.0.1 FALSE / FALSE 0 empty
-127.0.0.1 FALSE / FALSE 2054030187 ckyPersistent
permanent
+127.0.0.1 FALSE / FALSE 2054030210 ckyPersistent
permanent
127.0.0.1 FALSE / FALSE 0 ckySession temporary
127.0.0.1 FALSE / FALSE 0 ASPSESSIONIDQGGQQSJJ
GKNBDIFAAOFDPDAIEAKDIBKE
127.0.0.1 FALSE / FALSE 0 justaname
test 061...[HTTP with various cookies and custom Host:]

output FAILED:
--- log/check-expected 2007-07-01 10:39:25.000000000 +0200
+++ log/check-generated 2007-07-01 10:39:25.000000000 +0200
@@ -2,6 +2,6 @@
# http://curlm.haxx.se/rfc/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.

-.foo.com TRUE /we/want/ FALSE 2054030187 test
yes
-.host.foo.com TRUE /we/want/ FALSE 2054030187 test2
yes
+.foo.com TRUE /we/want/ FALSE 2054030210 test
yes
+.host.foo.com TRUE /we/want/ FALSE 2054030210 test2
yes
.foo.com TRUE /moo TRUE 0 test3 maybe
test 506...[HTTP with shared cookie list (and dns cache)]

output FAILED:
--- log/check-expected 2007-07-01 10:39:25.000000000 +0200
+++ log/check-generated 2007-07-01 10:39:25.000000000 +0200
@@ -2,8 +2,8 @@
# http://curlm.haxx.se/rfc/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.

-.foo.com TRUE / FALSE 1993463787 test1
overwritten1
-.host.foo.com TRUE / FALSE 1896263787 test2 two
-.foo.com TRUE / FALSE 1896263787 test3 three
-.host.foo.com TRUE / FALSE 2061978987 test4
overwritten4
-.host.foo.com TRUE / FALSE 1896263787 test5 five
+.foo.com TRUE / FALSE 1993463810 test1
overwritten1
+.host.foo.com TRUE / FALSE 1896263810 test2 two
+.foo.com TRUE / FALSE 1896263810 test3 three
+.host.foo.com TRUE / FALSE 2061979010 test4
overwritten4
+.host.foo.com TRUE / FALSE 1896263810 test5 five
test 517...[curl_getdate() testing]

stdout FAILED:
--- log/check-expected 2007-07-01 10:39:25.000000000 +0200
+++ log/check-generated 2007-07-01 10:39:25.000000000 +0200
@@ -1,22 +1,22 @@
-0: Sun, 06 Nov 1994 08:49:37 GMT => 784111777
-1: Sunday, 06-Nov-94 08:49:37 GMT => 784111777
-2: Sun Nov 6 08:49:37 1994 => 784111777
-3: 06 Nov 1994 08:49:37 GMT => 784111777
-4: 06-Nov-94 08:49:37 GMT => 784111777
-5: Nov 6 08:49:37 1994 => 784111777
-6: 06 Nov 1994 08:49:37 => 784111777
-7: 06-Nov-94 08:49:37 => 784111777
-8: 1994 Nov 6 08:49:37 => 784111777
-9: GMT 08:49:37 06-Nov-94 Sunday => 784111777
-10: 94 6 Nov 08:49:37 => 784111777
-11: 1994 Nov 6 => 784080000
-12: 06-Nov-94 => 784080000
-13: Sun Nov 6 94 => 784080000
-14: 1994.Nov.6 => 784080000
-15: Sun/Nov/6/94/GMT => 784080000
-16: Sun, 06 Nov 1994 08:49:37 CET => 784108177
-17: 06 Nov 1994 08:49:37 EST => 784129777
-18: Sun, 12 Sep 2004 15:05:58 -0700 => 1095026758
-19: Sat, 11 Sep 2004 21:32:11 +0200 => 1094931131
-20: 20040912 15:05:58 -0700 => 1095026758
-21: 20040911 +0200 => 1094853600
+0: Sun, 06 Nov 1994 08:49:37 GMT => 784111796
+1: Sunday, 06-Nov-94 08:49:37 GMT => 784111796
+2: Sun Nov 6 08:49:37 1994 => 784111796
+3: 06 Nov 1994 08:49:37 GMT => 784111796
+4: 06-Nov-94 08:49:37 GMT => 784111796
+5: Nov 6 08:49:37 1994 => 784111796
+6: 06 Nov 1994 08:49:37 => 784111796
+7: 06-Nov-94 08:49:37 => 784111796
+8: 1994 Nov 6 08:49:37 => 784111796
+9: GMT 08:49:37 06-Nov-94 Sunday => 784111796
+10: 94 6 Nov 08:49:37 => 784111796
+11: 1994 Nov 6 => 784080019
+12: 06-Nov-94 => 784080019
+13: Sun Nov 6 94 => 784080019
+14: 1994.Nov.6 => 784080019
+15: Sun/Nov/6/94/GMT => 784080019
+16: Sun, 06 Nov 1994 08:49:37 CET => 784108196
+17: 06 Nov 1994 08:49:37 EST => 784129796
+18: Sun, 12 Sep 2004 15:05:58 -0700 => 1095026780
+19: Sat, 11 Sep 2004 21:32:11 +0200 => 1094931153
+20: 20040912 15:05:58 -0700 => 1095026780
+21: 20040911 +0200 => 1094853622
TESTDONE: 0 tests out of 5 reported OK: 0%
TESTFAIL: These test cases failed: 31 46 61 506 517
TESTDONE: 5 tests were considered during 2 seconds.


Daniel Black ( grooverdan ) - 2007-07-01 08:43

3

Closed

Accepted

Daniel Stenberg

libcurl

bad behaviour

Public


Comments ( 11 )

Date: 2007-07-11 18:18
Sender: dfandrich


I'm not convinced this is (was) a problem in anything other than the test
harness. It's merely a problem of how the date values are represented
internally. As long as the time zone doesn't change dynamically while
libcurl runs, libcurl will operate correctly.


Date: 2007-07-11 16:44
Sender: bagderProject AdminAccepting Donations


Well, perhaps until then someone could identify exactly what the problem
and fix is...


Date: 2007-07-11 04:52
Sender: ricce_n


That is of course just a work around, but fully acceptable as this problem
isn't very severe and quite tricky to solve.

Just remember that the problem is not solved jet and someday you need to
truly solve it.


Date: 2007-07-10 22:28
Sender: dfandrich


I've committed the TZ=GMT patch in CVS.


Date: 2007-07-10 21:08
Sender: bagderProject AdminAccepting Donations


So I guess setting TZ to GMT (or perhaps something that isn't exactly the
same as UTC but still is a UTC-based timezone) unconditionally in the test
suite sounds like a good idea to at least avoid people getting these
failures.

ricce_n, any opinions?


Date: 2007-07-09 18:41
Sender: dfandrich


I tried the <setenv> trick and it worked on Linux.


Date: 2007-07-08 20:58
Sender: dfandrich


What about forcing the time zone to GMT from the test harness when running
this (or all) scripts? This might be as simple as adding
<setenv>TZ=GMT</setenv> in the script, although it would need to be
verified on non-POSIX platforms.


Date: 2007-07-08 12:53
Sender: grooverdan


i agree. I couldn't find a real solution without refactoring the test
expects for TAI timezones.


Date: 2007-07-07 20:44
Sender: bagderProject AdminAccepting Donations


That's certainly not what the _test suite_ assumes. That's what libcurl,
its time+date parser and/or the underlying date functions assume.

Feel free to work on a fix, I personally have no plans on doing that
within the near future as I consider this a minor flaw effecting a rare
few.


Date: 2007-07-07 11:09
Sender: ricce_n


TAI timezones adds leap seconds corrections.

Your test suite assumes that every day have exactly 24*60*60 seconds witch
is the case in UTC time but not in TAI.

See those pages for more info:
http://www.thedjbway.org/clockspeed/leapsecs.html
http://cr.yp.to/proto/utctai.html


Date: 2007-07-01 15:14
Sender: bagderProject AdminAccepting Donations


I have no idea how TAI time zones differ from UTC ones, and I also don't
see how libcurl bothers about timezones anywhere really (except for parsing
times) so what _can_ we do about this?



Attached File

No Files Currently Attached

Changes ( 6 )

Field Old Value Date By
status_id Open 2007-07-11 16:44 bagder
close_date - 2007-07-11 16:44 bagder
resolution_id Later 2007-07-10 22:28 dfandrich
resolution_id None 2007-07-07 20:44 bagder
priority 5 2007-07-01 15:14 bagder
summary self test failures in specific timezone 2007-07-01 09:07 grooverdan