RFR (XS): 8023004: JSR 292: java.lang.RuntimeException: Original target method was called.

Igor Veresov igor.veresov at oracle.com
Wed Oct 16 11:58:17 PDT 2013


Looks ok. Maybe add_method_name() should have an assert to verify that it's not overwriting the slot that's already used?

igor

On Oct 14, 2013, at 12:15 PM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:

> http://cr.openjdk.java.net/~vlivanov/8023004/webrev.00/
> 7 lines changed: 5 ins; 1 del; 1 mod
> 
> Assertion code in JDK fetches info from VM using MHN.getMemberVMInfo:
> assert(m.vminfoIsConsistent());
> 
> After that check, class redefinition is broken - it's still possible to invoke old version of a method.
> 
> Analysis from Serguei:
> "The problem is here:
> oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
>  . . . . . . . .
>  m->method_holder()->add_member_name(m->method_idnum(), mname);
> 
>  return mname();
> }
> 
> The call to add_member_name() resets the member name at the index m->method_idnum(). After that one of the two member names with the same method_idnum() is out of the MNT and is not updated when the method is redefined."
> 
> The fix is to check whether there's already a member name associated with the before creating a new one.
> 
> Testing: failing test.
> 
> Contributed-by: sspitsyn, vlivanov
> 
> Best regards,
> Vladimir Ivanov
> 
> JBS: https://bugs.openjdk.java.net/browse/JDK-8023004



More information about the hotspot-compiler-dev mailing list