RFR (M): 8026328: Setting a breakpoint on invokedynamic crashes the JVM

Christian Thalinger christian.thalinger at oracle.com
Wed Oct 23 09:05:02 PDT 2013

On Oct 23, 2013, at 6:03 AM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:

> Chris,
> -  ShouldNotReachHere();
> +  {
> +    ResourceMark rm;
> +    fatal(err_msg("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci));
> +  }
> Did you intend to use err_msg_res there?

No.  We usually use err_msg_res only in the compiler since err_msg_res can fail.  The ResourceMark is there because of name_and_sig_as_C_string().  But means it could also fail… ;-)

> Best regards,
> Vladimir Ivanov
> On 10/23/13 2:31 AM, Christian Thalinger wrote:
>> https://bugs.openjdk.java.net/browse/JDK-8026328
>> http://cr.openjdk.java.net/~twisti/8026328/webrev.00/
>> 8026328: Setting a breakpoint on invokedynamic crashes the JVM
>> Reviewed-by:
>> Well-known invoke instructions have a 2-byte index but invokedynamic has a 4-byte index.  In return entries we check the bytecode instruction to decide which size the index has.
>> The problem is that if there is a breakpoint there is no way to know what index size the instruction has because the original instruction byte was replaced with the breakpoint byte.
>> There are a couple of ways to fix this but the proper way (in my opinion) is to have separate return entries for the different classes of invoke instructions.  This on one hand generates more return entries but on the other hand makes them smaller and simpler.

More information about the hotspot-compiler-dev mailing list