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
On 09/25/2010 05:41 AM, Olson, Arthur David (NIH/NCI) [E] wrote:
Is there a place where I get pre-built zic binary for Linux?
Sure, every Linux distribution worth its salt has one. For example, in the current (10.04) Ubuntu distribution, zic is in the libc-bin package.
Thanks Paul. I had my PATH messed up. I found it under /usr/sbin. --- On Sun, 9/26/10, Paul Eggert <eggert@cs.ucla.edu> wrote:
From: Paul Eggert <eggert@cs.ucla.edu> Subject: Re: FW: zic and zoneinfo.zip To: "Ravindra" <rsahlot@yahoo.com> Cc: tz@elsie.nci.nih.gov Date: Sunday, September 26, 2010, 5:26 AM On 09/25/2010 05:41 AM, Olson, Arthur David (NIH/NCI) [E] wrote:
Is there a place where I get pre-built zic binary for Linux?
Sure, every Linux distribution worth its salt has one. For example, in the current (10.04) Ubuntu distribution, zic is in the libc-bin package.
Could someone on the list please help me proceed on valgrind issue? Thanks in advance. 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
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
-----Original Message----- From: Ravindra [mailto:rsahlot@yahoo.com]
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:
I wonder if the following IBM AIX fix is related? No idea what version of tzcode/tzdata it refers to. Perhaps someone with the right contacts in IBM can provide more info. IZ83517: MEMORY LEAK IN TZLOAD http://www-01.ibm.com/support/docview.wss?uid=isg1IZ83517 -- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
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
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);
Perhaps the extra parameter in your modified tzload() function has something to do with the problem? *** Regarding 64-bit and 32-bit, I have a 32-bit chrooted environment on my 64-bit system, and the data produced by 64-bit zic running outside the chrooted environment is identical to the data produced by the 32-bit zic running inside the 32-bit chrooted environment. (That's with the 2010l versions of tzcode and tzdata.) -- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
Olson, Arthur David (NIH/NCI) [E] <olsona@dc37a.nci.nih.gov> wrote:
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)
For this kind of Valgrind error, you can get more information if you rerun with valgrind option --track-origins=yes (default being no). This option is only available in recent valgrind versions (>= 3.5 I think). It should help to find the root cause of the issue. Regards -- Dominique
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)
For this kind of Valgrind error, you can get more information if you rerun with valgrind option --track-origins=yes (default being no). This option is only available in recent valgrind versions (>= 3.5 I think).
It should help to find the root cause of the issue.
I tried it and it just points to stack like below: ==21171== Uninitialised value was created by a stack allocation ==21171== at 0x1BA18FE: tzload (tz.c:232) Here is the code at line 232: 229 static int 230 tzload(const char * name, struct state *tz_state, 231 const int doextend, tz_errno_t * errnop) 232 { 233 const char * p = NULL; 234 int i = 0; 235 int stored = 0; 236 ssize_t nread = 0; 237 unzFile zfile = NULL; 238 union { 239 struct tzhead tzhead; 240 char buf[2 * sizeof(struct tzhead) + 241 2 * sizeof (struct state) + 242 4 * TZ_MAX_TIMES]; 243 } u = {0}; Thanks, Ravindra
participants (5)
-
Dominique Pellé -
Ian Abbott -
Olson, Arthur David (NIH/NCI) [E] -
Paul Eggert -
Ravindra