JDK-8007037 : JSR 292: the VM_RedefineClasses::append_entry() should do cross-checks with indy operands
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: hs20,hs23,hs24,hs25,7u60
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-01-28
  • Updated: 2014-10-15
  • Resolved: 2013-04-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u60Fixed 8Fixed hs25Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
The bug  https://jbs.oracle.com/bugs/browse/JDK-8006542 requires to add a support for
new CP entry kinds into the VM_RedefineClasses::append_entry():
   - JVM_CONSTANT_MethodType
   - JVM_CONSTANT_MethodHandle
   - JVM_CONSTANT_InvokeDynamic

This bug tracks that the append_entry() should also do necessary recursive cross-checks with the bootstrap method operands (arguments) attribute and append missed CP entries and operands if necessary. 

Comments
7u60-critical-request justification: This bug fix is better to be in the release because it is a part of the JSR-292 support in the JVMTI HotSwap API (includes RedefineClasses, RetransformClasses and PopFrame). This bug is one of 12 bug fixes that depend on each other and must be integrated in the order: https://jbs.oracle.com/bugs/browse/JDK-7194607 https://jbs.oracle.com/bugs/browse/JDK-8005128 https://jbs.oracle.com/bugs/browse/JDK-8006542 https://jbs.oracle.com/bugs/browse/JDK-8006546 https://jbs.oracle.com/bugs/browse/JDK-8006731 https://jbs.oracle.com/bugs/browse/JDK-8008511 https://jbs.oracle.com/bugs/browse/JDK-8007037 https://jbs.oracle.com/bugs/browse/JDK-8014288 https://jbs.oracle.com/bugs/browse/JDK-8013945 https://jbs.oracle.com/bugs/browse/JDK-8014052 https://jbs.oracle.com/bugs/browse/JDK-7187554 https://jbs.oracle.com/bugs/browse/JDK-8023004 All the fixes above have been already integrated into the JDK 8 and tested in the hotspot-rt nightly for several months. Risk: low The fixes touch the JVMTI HotSwap API that includes RedefineClasses, RetransformClasses and PopFrame. The risk is only to introduce regressions in this part of the JVMTI implementation. This impacts only the debugging and profiling tools that use the JVMTI HotSwap feature. There are very small chances for regressions to sneak into the class file constant pool processing and method handles implementation. Webrevs and reviewers: The 7u60 webrevs location is: http://javaweb.sfbay.sun.com/java/svc/ss45998/webrevs/2013/hotspot/7u_port/ The fixes above were already passed the review process before integration into JDK 8. The reviewers were: twisti, jrose, coleenp, dholmes, etc. The 7u60 edition of fixes must be reviewed at least by jrose and twisti. Level of effort: All fixes need a secondary review phase after rebase from jdk8 to 7u60 repository. Testing coverage: The folllowing test suites must be run to ensure correctness of the fixes: JTREG tests: com/sun/jdi, java/lang/instrument NSK tests: vm.mlvm.testlist, nsk.jvmti.testlist, nsk.jdi.testlist, nsk.jdwp.testlist Result of not integrating: The users will not be able to use HotSwap technology for debuging and profiling Java code that depends on the JSR-292 implementation. In that case the integration of these fixes will have to be requested/escalated in 7 updates by the tool vendors and/or customers.
10-01-2014

This fix is broken: + bool match = compare_entry_to(k1, cp2, k2, CHECK_false) && + compare_operand_to(i1, cp2, i2, CHECK_false); You can not use CHECK_ macros on functions that are then subject to boolean comparison. The above will expand to: bool match = compare_entry_to(k1, cp2, k2, THREAD); if (HAS_PENDING_EXCEPTION) return false; (0) && compare_operand_to(i1, cp2, i2, THREAD); if (HAS_PENDING_EXCEPTION) return false; (0); So match has the wrong value. See discussion from: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2013-May/007332.html
21-05-2013

This is a better description of the issue: References from INDY bootstrap method specifier operands to CP entries and back must be correctly merged at class redefinition. Some background. An invokedynamic bytecode spec: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.invokedynamic A invokedynamic instruction has an argument which is an index to the Constant Pool item. That index must be a symbolic reference to a call-site specifier: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.10 A CP item of the type CONSTANT_InvokeDynamic_inf has an index into the bootstrap method attribute of the class file: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.21 The BootstrapMethods attribute elements normally have references to other Constant Pool items. In VM the bootstrap method attribute is represented by the operands array of the ConstantPool. The problem is is that all the force and back cross links between ConstantPool elements and operands array elements must be correctly merged at class redefinition.
01-04-2013

Modified the filed "Affects Version's" according to the closed bug 7016264 as a dup of this one.
27-03-2013