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

crash: redefine classes method order change incomplete

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 6
    • Fix Version/s: 6
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b79
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        This bug affects the following JTREG test:

            java/lang/instrument/IsModifiableClassAgent.java

        When the new class file being processed by a redefine has a different method order than the original (even though the methods are sorted by method name at load time the order may still be different because of overloading) redefine needs to adjust the method orders to match-up (see 6328000).

        However, the implementation of 6328000 is incomplete. The order of the methods is changed, but the corollary changes are not done. Each of the following need to be adjusted:

          1. Methods know their index
          2. Method annotations are stored in parallel arrays in the class
          3. The EnclosingMethod annotation holds a method index
          4. vtable/itable order may be OK, but should be checked

        because of the first, the java.lang.instrument test IsModifiableClassAgent.java is crashing.

        Here is an example of the failing assert:

        IsModifiableClassAgent started
        modifiable: 315. unmodifiable: 45
        # To suppress the following error report, specify this argument
        # after -XX: or in .hotspotrc: SuppressErrorAt=/jniId.cpp:862]
        #
        # An unexpected error has been detected by Java Runtime Environment:
        #
        # Internal Error (/net/prt-solsparc-q1-10/tmp/PrtBuildDir/workspace/src/share/vm/prims/jniId.cpp, 862 [ Patched ]), pid=4346, tid=4
        #
        # Java VM: Java HotSpot(TM) 64-Bit Server VM (20060305005443.ss45998.hs_jref-debug mixed mode)
        #
        # Error: assert(jniIdSupport::checked_to_method_oop(jmid)->method_index() == method()->method_index(),"method indices don't match")
        # An error report file with more information is saved as hs_err_pid4346.log
        #
        # If you would like to submit a bug report, please visit:
        # http://java.sun.com/webapps/bugreport/crash.jsp
        #
        The previous entry mentions:

          4. vtable/itable order may be OK, but should be checked

        so this entry will document the checking. Method entry normalization
        is done in VM_RedefineClasses::compare_and_normalize_class_versions()
        which is called from VM_RedefineClasses::load_new_class_versions()
        which is called by the VM Operation's doit_prologue() function.

        The v/i-tables are initialized in VM_RedefineClasses::redefine_single_class()
        which is called by the VM Operation's doit() function. So v/i-table
        initialization takes place after method entries have been normalized
        so there is no work to do for item #4.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dcubed Daniel Daugherty
                  Reporter:
                  rfield Robert Field
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: