RFR 8042235: redefining method used by multiple MethodHandles crashes VM

Daniel D. Daugherty daniel.daugherty at oracle.com
Tue Nov 18 18:24:29 UTC 2014


On 11/17/14 3:49 PM, Coleen Phillimore wrote:
> Summary: note all MemberNames created on internal list for adjusting 
> method entries.
>
> The JVM MemberNameTable code will push all member names on the list 
> rather than trying to index by method_idnum.  The code to look up 
> MemberName types wasn't used so was removed.  Class redefinition 
> iterates through the table sequentially to update the Method* pointers 
> in saved member names.
>
> This change will work with David Chase's change to the Java code for 
> bug 8013267 without the extra code dealing with class redefinition.
>
> Tested with vm.quick.testlist, jck tests and jtreg tests, including 
> the mlvm tests that failed in the bug report.
>
> open webrev at http://cr.openjdk.java.net/~coleenp/8042235/

src/share/vm/classfile/javaClasses.hpp
     No comments.

src/share/vm/classfile/javaClasses.cpp
     No comments.

src/share/vm/oops/instanceKlass.hpp
     No comments.

src/share/vm/oops/instanceKlass.cpp
     line 2951: _member_names = new (ResourceObj::C_HEAP, mtClass) 
MemberNameTable(idnum_allocated_count());
         Not your bug, but what should happen if this new fails? Or
         is this one of the operator overrides that handles that by
         killing the VM?

src/share/vm/prims/jvm.cpp
     nit line 612: methodHandle m (THREAD, method);
         Please delete space between 'm ('.

     lines 607-609, 616: uses of 'new_obj'
         Should all of these be switched to 'new_obj_h()'?

         In particular, is line 616 subject to being moved by GC
         if the methodHandle creation goes to a safepoint?

     line 620: return JNIHandles::make_local(env, oop(new_obj_h()));
         is the 'oop(...)' around 'new_obj_h()' redundant? I might
         be rusty, but isn't 'new_obj_h()' the unhandled oop?

src/share/vm/prims/methodHandles.hpp
     No comments.

src/share/vm/prims/methodHandles.cpp
     No comments.

test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
     line 142 //    static class FooTransformer implements 
ClassFileTransformer, Opcodes {
         Do you still need this line?

Dan


> bug link https://bugs.openjdk.java.net/browse/JDK-8042235
>
> Thanks,
> Coleen



More information about the hotspot-dev mailing list