-
Bug
-
Resolution: Fixed
-
P2
-
6
-
b79
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2136658 | 5.0u8 | Daniel Daugherty | P2 | Resolved | Fixed | b01 |
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.
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.
- backported by
-
JDK-2136658 crash: redefine classes method order change incomplete
- Resolved
- relates to
-
JDK-5002251 potential bug with annotations and class file evolution
- Resolved
-
JDK-6328000 class redefinition failed "method deleted"
- Resolved
-
JDK-6272221 assertion failure in ContiguousSpace::block_size after massive number of RedefineClasses
- Resolved