JDK-8151879 : TZupdater not able to update with tzdata2016b release
  • Type: Bug
  • Component: tools
  • Sub-Component: updaters
  • Affected Version: 2.0x
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2016-03-15
  • Updated: 2016-03-16
  • Resolved: 2016-03-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
2.0.3 b01Fixed
Description
The tar extraction phase fails for tzupdater.

java.lang.IllegalArgumentException: Illegal tar entry: magic= below, size=0
Exception in thread "main" com.sun.tools.tzupdater.TzRuntimeException: java.lang.IllegalArgumentException: Illegal tar entry: magic= below, size=0
        at com.sun.tools.tzupdater.TimezoneUpdater.main(TimezoneUpdater.java:640)
Caused by: java.lang.IllegalArgumentException: Illegal tar entry: magic= below, size=0
        at com.sun.tools.tzupdater.utils.TarInputStream$TarEntry.<init>(TarInputStream.java:305)
        at com.sun.tools.tzupdater.utils.TarInputStream.getNextEntry(TarInputStream.java:141)
        at com.sun.tools.tzupdater.ExternalModule.extractFiles(ExternalModule.java:92)
        at com.sun.tools.tzupdater.TimezoneUpdater.run(TimezoneUpdater.java:184)
        at com.sun.tools.tzupdater.TimezoneUpdater.main(TimezoneUpdater.java:621)

Comments
Issue was triggered by files aligning exactly to a 512-byte block size in the tzdata2016b.tar file. A bug was lurking in the TarInputStream and reading ahead on the tar stream incorrectly. Corrected in tzupdater v2.0.3
16-03-2016

A debug copy shows that the TarEntry constructor checks fail. Here's the processing of tar file to date : t4 $~/h1/jdk/jdk1.7.0_85/bin/java -jar tzupdater.jar -l http://www.iana.org/time-zones/repository/releases/tzdata2016b.tar.gz name : CONTRIBUTING name : LICENSE name : Makefile name : NEWS name : README name : Theory name : africa name : antarctica name : asia name : australasia name : europe name : northamerica name : southamerica name : pacificnew name : etcetera name : backward name : systemv name : factory name : backzone name : iso3166.tab name : leapseconds name : zone1970.tab name : zone.tab name : # # In the following text, the symbol '#' introduces # a comment, which continues from that symbol u java.lang.IllegalArgumentException: Illegal tar entry: magic= below, size=0 Exception in thread "main" com.sun.tools.tzupdater.TzRuntimeException: java.lang.IllegalArgumentException: Illegal tar entry: magic= below, size=0 at com.sun.tools.tzupdater.TimezoneUpdater.main(TimezoneUpdater.java:647) Caused by: java.lang.IllegalArgumentException: Illegal tar entry: magic= below, size=0 at com.sun.tools.tzupdater.utils.TarInputStream$TarEntry.<init>(TarInputStream.java:306) at com.sun.tools.tzupdater.utils.TarInputStream.getNextEntry(TarInputStream.java:141) at com.sun.tools.tzupdater.ExternalModule.extractFiles(ExternalModule.java:92) at com.sun.tools.tzupdater.TimezoneUpdater.run(TimezoneUpdater.java:184) at com.sun.tools.tzupdater.TimezoneUpdater.main(TimezoneUpdater.java:628) public TarEntry(byte[] header) { //this.header = header; this.name = toString(header, NAME_OFF, NAME_LEN); this.size = toNumber(header, SIZE_OFF, SIZE_LEN); System.out.println("name : " + name); // verify magic and size String magic = toString(header, MAGIC_OFF, MAGIC_LEN); if (!magic.startsWith("ustar") || size < 0 || size > MAXSIZE) { throw new IllegalArgumentException("Illegal tar entry: magic=" + magic + ", size=" + size); } }
15-03-2016