I rebased to the latest and did some testing. I didn't got any more segmentation fault, so that is fixed. However, I encountered something else related to the truncation. I compiled with the following range 1977-1984 : ./zic -L /dev/null -d $ZONEINFO -r @220924800/@441763200 ${tz} ./zdump -v $ZONEINFO/Australia/Perth The result I got was: /home/christwo/dists/tz/test_zic_github/Australia/Perth -9223372036854775808 = NULL /home/christwo/dists/tz/test_zic_github/Australia/Perth -9223372036854689408 = NULL /home/christwo/dists/tz/test_zic_github/Australia/Perth Sat Oct 29 17:59:59 1983 UT = Sun Oct 30 01:59:59 1983 AWST isdst=0 gmtoff=28800 /home/christwo/dists/tz/test_zic_github/Australia/Perth Sat Oct 29 18:00:00 1983 UT = Sun Oct 30 03:00:00 1983 AWDT isdst=1 gmtoff=32400 /home/christwo/dists/tz/test_zic_github/Australia/Perth 9223372036854689407 = NULL /home/christwo/dists/tz/test_zic_github/Australia/Perth 9223372036854775807 = NULL I was expecting many dates before 1983. I made a hexdump from the Australia/Perth TZif file: 00000000 54 5a 69 66 32 00 00 00 00 00 00 00 00 00 00 00 |TZif2...........| 00000010 00 00 00 00 00 00 00 02 00 00 00 02 00 00 00 00 |................| 00000020 00 00 00 03 00 00 00 02 00 00 00 0a 0d 2b 0b 80 |.............+..| 00000030 1a 01 62 a0 1a 54 c5 81 00 01 01 00 00 70 80 00 |..b..T.......p..| 00000040 00 00 00 7e 90 01 05 41 57 53 54 00 41 57 44 54 |...~...AWST.AWDT| 00000050 00 01 01 00 00 54 5a 69 66 32 00 00 00 00 00 00 |.....TZif2......| 00000060 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 |................| 00000070 02 00 00 00 00 00 00 00 03 00 00 00 02 00 00 00 |................| 00000080 0a 00 00 00 00 0d 2b 0b 80 00 00 00 00 1a 01 62 |......+........b| 00000090 a0 00 00 00 00 1a 54 c5 81 00 01 01 00 00 70 80 |......T.......p.| 000000a0 00 00 00 00 7e 90 01 05 41 57 53 54 00 41 57 44 |....~...AWST.AWD| 000000b0 54 00 01 01 00 00 0a 0a |T.......| 000000b8
From it I extracted the timestamps below, should the last transition be 1s after range end?
0d 2b 0b 80 220924800 Saturday, January 1, 1977 0:00:00 1a 01 62 a0 436298400 Saturday, October 29, 1983 18:00:00 1a 54 c5 81 441763201 Sunday, January 1, 1984 0:00:01 According to RFC 8536: When truncating the end of a TZif file, the service MUST supply in the version 2+ data a last transition time that is the end point of the truncation range I was kind of expecting the last transition to be within my supplied range or am I misinterpreting the RFC? BR, Christopher Wong ________________________________________ From: Paul Eggert <eggert@cs.ucla.edu> Sent: Thursday, March 14, 2019 17:30 To: Christopher Wong Cc: Scott Nelson; Time Zone Mailing List Subject: Re: [tz] [PROPOSED] zic option for including data from a certain year onward On 3/12/19 5:01 AM, Christopher Wong wrote:
If I do: make clean make ... install as you specified, then I don't see the segmentation faults either. I guess, I just didn't do it the right way.
No, your approach should have worked, even though -y is obsolescent and your use of it had no effect and we should remove -y one of these days. I installed the attached patch to fix the bug that you found. Thanks for reporting it.