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

Pack200 Java implementation differs from C version, outputs unused UTF8 for BootstrapMethods

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      The Pack200 spec is designed to specify the bitwise image of uncompressed files.
      So both implementations of the unpacker (C and Java) should produce the same output.
      A disagreement signals a bug in one or both implementations.

      Jeroen Fritjers reports: It appears that under some (difficult to isolate so far) circumstances, the "BootstrapMethods" UTF8 CP entry ends up in the class, even though there aren't any bootstrap methods.

      Jeroen also says that moving the statement in PackageReader.java that begins "if (bsms.isEmpty())" before the statement "int changed = cls.expandLocalICs();" seems to fix the problem.

      The correctness of constant pool pruning depends sensitively on the ordering of other stripping operations. It also interacts with the pruning of BootstrapMethods and InnerClasses attributes (which are also global tables for Pack200). It may be that a more iterative code pattern is required in PackageReader.reconstructLocalCPMap, which would prune the class file's symbolic references until nothing changes. On the other hand, it may be enough to find the most correct static ordering of pruning operations, as in Jeroen's suggested fix.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ksrini Kumar Srinivasan
                Reporter:
                jrose John Rose
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: