I'm forwarding this message from Ravindra, who is not on the time zone mailing list. Those of you who are on the list, please direct replies appropriately. --ado -----Original Message----- From: Ravindra [mailto:rsahlot@yahoo.com] Sent: Monday, September 27, 2010 8:09 To: 'tz@elsie.nci.nih.gov'; Olson, Arthur David (NIH/NCI) [E] Subject: Re: FW: zic and zoneinfo.zip More testing on this revealed that it happens only when I use tzdata from version "2010l" on a 64-bit platform (localtime.c compiled as 64-bit code). valgrind does not report the memory error if localtime.c is compiled as 32-bit code or if I use tzdata2007k with tzcode2010l. Looks like, tzcode2010l and tzdata2010l do not get well together on 64-bit? Thanks, Ravindra --- On Sat, 9/25/10, Olson, Arthur David (NIH/NCI) [E] <olsona@dc37a.nci.nih.gov> wrote:
From: Olson, Arthur David (NIH/NCI) [E] <olsona@dc37a.nci.nih.gov> Subject: FW: zic and zoneinfo.zip To: "'tz@elsie.nci.nih.gov'" <tz@elsie.nci.nih.gov> Cc: "'rsahlot@yahoo.com'" <rsahlot@yahoo.com> Date: Saturday, September 25, 2010, 6:11 PM I'm forwarding this message from Ravindra, who is not on the time zone mailing list. Those of you who are on the list, please direct replies appropriately.
(Note that the line numbers below are indeed different from those in the 2010l on elsie.nci.nih.gov, and that there's no "tz.c" file with a "tz_validate" function in 2010l on elsie.nci.nih.gov.)
--ado
-----Original Message----- From: Ravindra [mailto:rsahlot@yahoo.com]
Sent: Saturday, September 25, 2010 8:01 To: Olson, Arthur David (NIH/NCI) [E] Subject: RE: zic and zoneinfo.zip
Thanks Arthur!
Is there a place where I get pre-built zic binary for Linux?
I got the doubt because I could build 32-bit zic as well as 64-bit zic from source code, and I was not sure whether to build zic as a 32-bit binary or 64-bit binary. What I'm getting from your response is I can use either version of zic and use the generated timezone data files on either platform.
BTW, I'm looking at various possibilities because I'm using the code and data from version "2010l" and I'm hitting following memory error in valgrind log:
==5207== Thread 27: ==5207== Conditional jump or move depends on uninitialised value(s) ==5207== at 0x1B9F988: typesequiv (localtime.c:522) ==5207== by 0x1B9F830: tzload (localtime.c:493) ==5207== by 0x1BA261B: tz_validate (tz.c:1717)
Below call is hitting above memory error (line numbers may not match with original code because we have integrated it in our code):
1712 struct state state = {0}; 1713 time_t now; 1714 struct tm tm; 1715 1716 time(&now); *** 1717 tzload(gmt, &state, TRUE, 0); ...
tzload code: ... 486 if (sp->timecnt > 1) { 487 for (i = 1; i < sp->timecnt; ++i) 488 if (typesequiv(sp, sp->types[i], sp->types[0]) && 489 differ_by_repeat(sp->ats[i], sp->ats[0])) { 490 sp->goback = TRUE; 491 break; 492 } **** 493 for (i = sp->timecnt - 2; i >= 0; --i) 494 if (typesequiv(sp, sp->types[sp->timecnt - 1], 495 sp->types[i]) && 496 differ_by_repeat(sp->ats[sp->timecnt - 1], 497 sp->ats[i])) { 498 sp->goahead = TRUE; 499 break; 500 } 501 } ... 511 static int 512 typesequiv(const struct state * const sp, const int a, const int b) 513 { 514 register int result; 515 516 if (sp == NULL || 517 a < 0 || a >= sp->typecnt || 518 b < 0 || b >= sp->typecnt) 519 result = FALSE; 520 else { 521 register const struct ttinfo * ap = &sp->ttis[a]; *** 522 register const struct ttinfo * bp = &sp->ttis[b]; 523 result = ap->tt_gmtoff == bp->tt_gmtoff && 524 ap->tt_isdst == bp->tt_isdst && 525 ap->tt_ttisstd == bp->tt_ttisstd && 526 ap->tt_ttisgmt == bp->tt_ttisgmt && 527 strcmp(&sp->chars[ap->tt_abbrind], 528 &sp->chars[bp->tt_abbrind]) == 0; 529 } 530 return result; 531 }
It will be great if you are aware of fix for this or if you could help me how to proceed on this. I can explore this further but I'm new to this code.
Thanks in advance, Ravindra
--- On Fri, 9/24/10, Olson, Arthur David (NIH/NCI) [E] <olsona@dc37a.nci.nih.gov> wrote:
From: Olson, Arthur David (NIH/NCI) [E] <olsona@dc37a.nci.nih.gov> Subject: RE: zic and zoneinfo.zip To: "Ravindra" <rsahlot@yahoo.com> Date: Friday, September 24, 2010, 6:40 PM The current version of zic generates, for each time zone, a binary file that includes both 32-bit and 64-bit versions of the zone's data; the binary files should be usable on both 32- and 64-bit systems.
--ado
From: Ravindra [mailto:rsahlot@yahoo.com] Sent: Monday, September 27, 2010 8:09
More testing on this revealed that it happens only when I use tzdata from version "2010l" on a 64-bit platform (localtime.c compiled as 64-bit code). valgrind does not report the memory error if localtime.c is compiled as 32-bit code or if I use tzdata2007k with tzcode2010l.
I don't observe the problem with version 2010m on 64-bit RHEL with my GCC 4.5.1 installation. After running the following commands: wget ftp://elsie.nci.nih.gov/pub/tzcode2010m.tar.gz wget ftp://elsie.nci.nih.gov/pub/tzdata2010m.tar.gz tar xf tzcode2010m.tar.gz tar xf tzdata2010m.tar.gz make TOPDIR=`pwd`/topdir ALL install TZ=`pwd`/topdir/etc/zoneinfo/America/Los_Angeles valgrind ./date the output of the valgrind session is: ==723== Memcheck, a memory error detector ==723== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==723== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==723== Command: ./date ==723== Mon Sep 27 09:57:23 PDT 2010 ==723== ==723== HEAP SUMMARY: ==723== in use at exit: 0 bytes in 0 blocks ==723== total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated ==723== ==723== All heap blocks were freed -- no leaks are possible ==723== ==723== For counts of detected and suppressed errors, rerun with: -v ==723== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
I don't observe the problem with version 2010m on 64-bit RHEL with my GCC 4.5.1 installation. After running the following commands:
wget ftp://elsie.nci.nih.gov/pub/tzcode2010m.tar.gz wget ftp://elsie.nci.nih.gov/pub/tzdata2010m.tar.gz tar xf tzcode2010m.tar.gz tar xf tzdata2010m.tar.gz make TOPDIR=`pwd`/topdir ALL install TZ=`pwd`/topdir/etc/zoneinfo/America/Los_Angeles valgrind ./date
the output of the valgrind session is:
==723== Memcheck, a memory error detector ==723== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==723== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==723== Command: ./date ==723== Mon Sep 27 09:57:23 PDT 2010 ==723== ==723== HEAP SUMMARY: ==723== in use at exit: 0 bytes in 0 blocks ==723== total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated ==723== ==723== All heap blocks were freed -- no leaks are possible ==723== ==723== For counts of detected and suppressed errors, rerun with: -v ==723== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
It does not happen for all the timezones. It is happening only for a subset. One timezone for which I'm able to reproduce it consistently is "EST5EDT". Basically, if I do tzload for "EST5EDT" timezone on 64-bit systems using tzcode2010l and tzdata2010l, then valgrind reports this error. Thanks, Ravindra
On 09/28/10 00:07, Ravindra wrote:
It does not happen for all the timezones. It is happening only for a subset. One timezone for which I'm able to reproduce it consistently is "EST5EDT".
I can't reproduce it for "EST5EDT" either, on my same setup as before: $ TZ=EST5EDT valgrind ./date ==15536== Memcheck, a memory error detector ==15536== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==15536== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==15536== Command: ./date ==15536== Tue Sep 28 12:43:07 EDT 2010 ==15536== ==15536== HEAP SUMMARY: ==15536== in use at exit: 0 bytes in 0 blocks ==15536== total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated ==15536== ==15536== All heap blocks were freed -- no leaks are possible ==15536== ==15536== For counts of detected and suppressed errors, rerun with: -v ==15536== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
I can't reproduce it for "EST5EDT" either, on my same setup as before:
$ TZ=EST5EDT valgrind ./date ==15536== Memcheck, a memory error detector ==15536== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==15536== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==15536== Command: ./date ==15536== Tue Sep 28 12:43:07 EDT 2010 ==15536== ==15536== HEAP SUMMARY: ==15536== in use at exit: 0 bytes in 0 blocks ==15536== total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated ==15536== ==15536== All heap blocks were freed -- no leaks are possible ==15536== ==15536== For counts of detected and suppressed errors, rerun with: -v ==15536== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
I don't see date.c calling tzload() function, is that the reason you are not seeing it?
participants (3)
-
Olson, Arthur David (NIH/NCI) [E] -
Paul Eggert -
Ravindra