United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7049415 Failure of resolution of sym.reference to the c.s.s. should be wrapped in BootstrapMethodError
7049415 : Failure of resolution of sym.reference to the c.s.s. should be wrapped in BootstrapMethodError

Details
Type:
Bug
Submit Date:
2011-05-28
Status:
Resolved
Updated Date:
2012-12-05
Project Name:
JDK
Resolved Date:
2011-06-04
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs21

Related Reports
Backport:
Backport:
Backport:

Sub Tasks

Description
See comments.

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/ba550512d3b2
                                     
2011-06-09
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/ba550512d3b2
                                     
2011-06-04
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/60b8287df30e
                                     
2011-06-03
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/60b8287df30e
                                     
2011-06-02
SUGGESTED FIX

From: John Rose <###@###.###>
Date: June 1, 2011 11:44:29 AM PDT
To: hotspot compiler <###@###.###>
Subject: review request (URGENT): 7049415: Failure of resolution of sym.reference to the c.s.s. should be wrapped in BootstrapMethodError 

Low-level fix to ensure wrapping of early linkage errors in bootstrap method errors, for invokedynamic corner cases.

7049415: Failure of resolution of sym.reference to the c.s.s. should be wrapped in BootstrapMethodError
JVM Summary: Delegate invokedynamic linkage errors to MethodHandleNatives.raiseException.
JDK Summary: Wrap invokedynamic linkage errors in BootstrapMethodError, as needed.

http://cr.openjdk.java.net/~jrose/7049415/webrev.jvm.00
http://cr.openjdk.java.net/~jrose/7049415/webrev.jdk.00

These changes can integrate in any order.  To fix the bug, both must be integrated.

Test case attached.  All paths have been exercised.

-- John

<Test 7049415.java>
                                     
2011-06-01
EVALUATION

A corner case of a corner case, but covered by the JCK:  If an invokedynamic instruction fails to link because a constant pool reference fails to resolve before the BSM is invoked, the JVM can fail to wrap the LinkageError inside a BootstrapMethodError (which is also a LinkageError).

Thus, users who (a) have broken indy instructions and (b) are catching BSME (but not LE) will be surprised by a lack of spec. compliance.

The fix is fairly simple:  Cut into the JVM routine which resolves an invokedynamic instruction, and cause it to verify any LinkageError is in fact a BSME.  If a stray LE is found, wrap it.  We have to call up to Java to get the wrapping done.  Ungraceful, but it works.
                                     
2011-06-01



Hardware and Software, Engineered to Work Together