Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6869274

IllegalArgumentException: invalid entry crc-32

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • 7
    • 7
    • hotspot
    • None
    • generic
    • generic

      Running ant with jdk7 or openjdk7.
      My ant script does something like:

       <unzip src="${drop.bundle}" dest="${drop.dir}"/>

      I'm getting this exception:

      BUILD FAILED
      java.lang.IllegalArgumentException: invalid entry crc-32
              at java.util.zip.ZipEntry.setCrc(ZipEntry.java:186)
              at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:300)
              at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:152)
              at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:137)
              at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:107)
              at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:623)
              at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
              at org.apache.tools.ant.Task.perform(Task.java:348)
              at org.apache.tools.ant.Target.execute(Target.java:357)
              at org.apache.tools.ant.Target.performTasks(Target.java:385)
              at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
              at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
              at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
              at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
              at org.apache.tools.ant.Main.runBuild(Main.java:758)
              at org.apache.tools.ant.Main.startAnt(Main.java:217)
              at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
              at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

      This was happening on Solaris 10 X86, jdk7 java and ant 1.7.1 in PATH, sample build.xml file is:

      With jdk6:

      bonsai<1> ant
      Buildfile: build.xml

      all:
           [copy] Copying 1 file to /home/ohair
          [mkdir] Created dir: /home/ohair/dir
          [unzip] Expanding: /home/ohair/xyz.zip into /home/ohair/dir

      BUILD SUCCESSFUL
      Total time: 23 seconds

      With jdk7:

      bonsai<2> ( set path = ( /opt/java/jdk1.7.0/bin ${path} ) ; ant )
      Buildfile: build.xml

      all:
         [delete] Deleting: /home/ohair/xyz.zip
           [copy] Copying 1 file to /home/ohair
         [delete] Deleting directory /home/ohair/dir
          [mkdir] Created dir: /home/ohair/dir
          [unzip] Expanding: /home/ohair/xyz.zip into /home/ohair/dir

      BUILD FAILED
       (exception from above)

      bonsai<4> cat build.xml
      <?xml version="1.0"?>
      <project name="xyz" default="all" basedir=".">
          <target name="all">
             <delete file="xyz.zip"/>
             <copy file="/java/devtools/share/jaxp/jdk7-jaxp-m5.zip"
                    tofile="xyz.zip"/>
             <delete dir="dir"/>
             <mkdir dir="dir"/>
             <unzip src="xyz.zip" dest="dir"/>
          </target>
      </project>
      ###@###.### supplied a smaller test case (modified here to count loops):

      public class Foo {

          private static final long BYTE_3_MASK = 0xFF000000L;
          private static final int BYTE_3_SHIFT = 24;

          public static void main(String[] args) {
              java.util.Random r = new java.util.Random();
              byte[] bb = new byte[1];
              long nLoops = 0;

      while(true) {
                  nLoops++;
                  r.nextBytes(bb);

                  long l = (bb[0] << BYTE_3_SHIFT) & BYTE_3_MASK;

      if (bb[0] < 0)
                      System.out.printf(" [toLong]: %x -> %x%n",
      bb[0] & 0xff, l);

                  if ((l & 0xf00000000L) != 0) {
                      System.out.printf(nLoops + " Masking failed!%n");
                      break;
      }
              }
          }
      }

      The test case will run for many minutes on my Solaris-x64 desktop
      if I use "-Xint" or "-client"

      If I run with my local copy of JDK7 b67 and "-server", I get a failure
      at about 14000 iterations, right after Foo:main is compiled:

      % /opt/java/jdk1.7.0-b67/fastdebug/bin/java -server \
         -showversion -ea -esa -Xbatch -XX:+PrintCompilation Foo

          [... output trimmed...]

        [toLong]: d4 -> d4000000
        [toLong]: df -> df000000
        [toLong]: be -> be000000
        1% b Foo::main @ 14 (124 bytes)
        [toLong]: a7 -> ffffffffa7000000
        1% made not entrant (2) Foo::main @ 14 (124 bytes)
      14564 Masking failed!



      If I add one more flag: -XX:CompileOnly=Foo::main

      /opt/java/jdk1.7.0-b67/fastdebug/bin/java -server \
         -showversion -ea -esa -Xbatch -XX:+PrintCompilation \
         -XX:CompileOnly=Foo::main Foo

      I still get a failure:

        [toLong]: e8 -> e8000000
        [toLong]: f6 -> f6000000
        [toLong]: cc -> cc000000
        [toLong]: 9c -> 9c000000
        1% b Foo::main @ 14 (124 bytes)
        [toLong]: e4 -> ffffffffe4000000
        1% made not entrant (2) Foo::main @ 14 (124 bytes)
      14564 Masking failed!

            twisti Christian Thalinger (Inactive)
            ohair Kelly Ohair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: