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

SA does not include StackMapTables when dumping .class files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 8, 9, 14, 15
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:
      None

      Description

      There are a number of ways to get SA to dump the in memory version of a class into a .class file. For example, within clhsdb the buildreplayjars and dumpclass commands both do so, as does the SA ClassDump "tool", which is effectively the same as buildreplayjars. All of these rely on the ClassWriter class to generate the .class file, but it neglects to include the StackMapTable code attributes when dumping. This result in a VerifyError for classefile versions 51 and later (JDK 1.7) when trying to use these classes.

      It might not be too hard to get ClassWriter to include StackMapTable code attributes. They can be found in the ConstMethod::_stackmap_data field. However, it's unclear if this is all that is needed to make these dumped classes runnable. It appears that classes have not been runnable since JDK 1.7, and probably there are other classfile changes since then that ClassWriter is not aware of and needs to be.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: