Redefinition of a method that originally used 1 or more lambda expressions and after redefinition has removed any lambda expression causes the JVM to hang. See attached test case RedefineSubtractLambdaExpression.java
The issue is in:
(gdb) where
#0 0x00007f310cd0b763 in java_lang_invoke_ResolvedMethodName::vmtarget (resolved_method=...) at src/hotspot/share/classfile/javaClasses.cpp:3250
#1 0x00007f310d330661 in ResolvedMethodTable::adjust_method_entries (trace_name_printed=trace_name_printed@entry=0x7f2efef0ba10)
at src/hotspot/share/prims/resolvedMethodTable.cpp:208
#2 0x00007f310cf1bdc8 in VM_RedefineClasses::doit (this=0x7f2efd0c8ce0) at src/hotspot/share/prims/jvmtiRedefineClasses.cpp:216
The infinite recursion is due to ResolvedMethodTable::adjust_method_entries() not knowing how to handle a deleted method. In this case the deleted method is one of the private static indy methods resulting from the removed lambda expression.
Suspicious code in adjust_method_entries:
oop mem_name = entry->literal();
Method* old_method = (Method*)java_lang_invoke_ResolvedMethodName::vmtarget(mem_name);
if (old_method->is_old()) {
if (old_method->is_deleted()) {
// leave deleted method in ResolvedMethod for now (this is a bug that we don't mark
// these on_stack)
continue;
}
The issue is in:
(gdb) where
#0 0x00007f310cd0b763 in java_lang_invoke_ResolvedMethodName::vmtarget (resolved_method=...) at src/hotspot/share/classfile/javaClasses.cpp:3250
#1 0x00007f310d330661 in ResolvedMethodTable::adjust_method_entries (trace_name_printed=trace_name_printed@entry=0x7f2efef0ba10)
at src/hotspot/share/prims/resolvedMethodTable.cpp:208
#2 0x00007f310cf1bdc8 in VM_RedefineClasses::doit (this=0x7f2efd0c8ce0) at src/hotspot/share/prims/jvmtiRedefineClasses.cpp:216
The infinite recursion is due to ResolvedMethodTable::adjust_method_entries() not knowing how to handle a deleted method. In this case the deleted method is one of the private static indy methods resulting from the removed lambda expression.
Suspicious code in adjust_method_entries:
oop mem_name = entry->literal();
Method* old_method = (Method*)java_lang_invoke_ResolvedMethodName::vmtarget(mem_name);
if (old_method->is_old()) {
if (old_method->is_deleted()) {
// leave deleted method in ResolvedMethod for now (this is a bug that we don't mark
// these on_stack)
continue;
}
- relates to
-
JDK-8203225 Fix of redefining a method that removes 1 or more lambda expressions failed to commit test cases
- Resolved