JDK-8256674 : assert failed: "old methods should not be in vtable"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2020-11-19
  • Updated: 2020-11-19
  • Resolved: 2020-11-19
Related Reports
Duplicate :  
Relates :  
Description
The test java/lang/instrument/isModifiableClassAgent.java fails with

#  assert(!m->is_old() || ik()->is_being_redefined()) failed: old methods should not be in vtable
#
# JRE version: Java(TM) SE Runtime Environment (16.0+25) (fastdebug build 16-ea+25-1641)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 16-ea+25-1641, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1234b30]  klassVtable::put_method_at(Method*, int)+0x510

This appears to have started when JDK-8256365 was pushed.

Stack: [0x00007f66277cc000,0x00007f66278cd000],  sp=0x00007f66278c9420,  free space=1013k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1234b30]  klassVtable::put_method_at(Method*, int)+0x510
V  [libjvm.so+0x1241e31]  klassVtable::initialize_vtable(bool, Thread*)+0x14c1
V  [libjvm.so+0xdefc83]  InstanceKlass::restore_unshareable_info(ClassLoaderData*, Handle, PackageEntry*, Thread*)+0x223
V  [libjvm.so+0x1826228]  SystemDictionary::load_shared_class(InstanceKlass*, Handle, Handle, ClassFileStream const*, PackageEntry*, Thread*)+0x208
V  [libjvm.so+0x1826893]  SystemDictionary::load_instance_class(Symbol*, Handle, Thread*)+0x393
V  [libjvm.so+0x182507a]  SystemDictionary::resolve_instance_class_or_null(Symbol*, Handle, Handle, Thread*)+0x9ca
V  [libjvm.so+0x1827207]  SystemDictionary::resolve_or_fail(Symbol*, Handle, Handle, bool, Thread*)+0x27
V  [libjvm.so+0xa42d20]  ConstantPool::klass_at_impl(constantPoolHandle const&, int, bool, Thread*)+0x250
V  [libjvm.so+0xe21424]  InterpreterRuntime::_new(JavaThread*, ConstantPool*, int)+0x94
j  java.util.Arrays$ArrayList.iterator()Ljava/util/Iterator;+0 java.base@16-ea
j  java.lang.invoke.MethodHandles.dropArguments0(Ljava/lang/invoke/MethodHandle;ILjava/util/List;)Ljava/lang/invoke/MethodHandle;+47 java.base@16-ea
j  java.lang.invoke.MethodHandles.dropArguments(Ljava/lang/invoke/MethodHandle;I[Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;+6 java.base@16-ea
j  java.lang.invoke.StringConcatFactory.generateMHInlineCopy(Ljava/lang/invoke/MethodType;Ljava/util/List;)Ljava/lang/invoke/MethodHandle;+266 java.base@16-ea
j  java.lang.invoke.StringConcatFactory.makeConcatWithConstants(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;+220 java.base@16-ea
j  java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+18 java.base@16-ea
j  java.lang.invoke.DelegatingMethodHandle$Holder.delegate(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+21 java.base@16-ea
j  java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+26 java.base@16-ea
j  java.lang.invoke.BootstrapMethodInvoker.invoke(Ljava/lang/Class;Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+134 java.base@16-ea
j  java.lang.invoke.CallSite.makeSite(Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/invoke/CallSite;+8 java.base@16-ea
j  java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(Ljava/lang/Class;Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;+6 java.base@16-ea
j  java.lang.invoke.MethodHandleNatives.linkCallSite(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;+46 java.base@16-ea
v  ~StubRoutines::call_stub
V  [libjvm.so+0xe34ce5]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x595
V  [libjvm.so+0xe36222]  JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x312
V  [libjvm.so+0x1821b61]  SystemDictionary::invoke_bootstrap_method(BootstrapInfo&, Thread*)+0x2e1
V  [libjvm.so+0x128d9a5]  LinkResolver::resolve_dynamic_call(CallInfo&, BootstrapInfo&, Thread*)+0x25
V  [libjvm.so+0x128def6]  LinkResolver::resolve_invokedynamic(CallInfo&, constantPoolHandle const&, int, Thread*)+0x136
V  [libjvm.so+0xe20c53]  InterpreterRuntime::resolve_invokedynamic(JavaThread*)+0x1b3
V  [libjvm.so+0xe26388]  InterpreterRuntime::resolve_from_cache(JavaThread*, Bytecodes::Code)+0x238
j  IsModifiableClassAgent.premain(Ljava/lang/String;Ljava/lang/instrument/Instrumentation;)V+244
v  ~StubRoutines::call_stub
V  [libjvm.so+0xe34ce5]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x595
V  [libjvm.so+0x1677315]  invoke(InstanceKlass*, methodHandle const&, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*) [clone .constprop.0]+0xee5
V  [libjvm.so+0x167849a]  Reflection::invoke_method(oop, Handle, objArrayHandle, Thread*)+0x19a
V  [libjvm.so+0xfe995b]  JVM_InvokeMethod+0x1cb
j  jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@16-ea
j  jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+146 java.base@16-ea
j  jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@16-ea
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@16-ea
j  sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V+180 java.instrument@16-ea
j  sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Ljava/lang/String;Ljava/lang/String;)V+6 java.instrument@16-ea
v  ~StubRoutines::call_stub
V  [libjvm.so+0xe34ce5]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x595
V  [libjvm.so+0xf6bb07]  jni_invoke_nonstatic(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .constprop.2]+0x367
V  [libjvm.so+0xf71cbb]  jni_CallVoidMethod+0x21b
C  [libinstrument.so+0x37e7]  invokeJavaAgentMainMethod+0x67
C  [libinstrument.so+0x3adf]  processJavaStart+0x14f
C  [libinstrument.so+0x2eee]  eventHandlerVMInit+0x5e
V  [libjvm.so+0x11e4595]  JvmtiExport::post_vm_initialized()+0x205
V  [libjvm.so+0x1891f51]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x851
V  [libjvm.so+0xf7c418]  JNI_CreateJavaVM+0x98
C  [libjli.so+0x373f]  JavaMain+0x8f
C  [libjli.so+0x7949]  ThreadJavaMain+0x9

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  java.util.Arrays$ArrayList.iterator()Ljava/util/Iterator;+0 java.base@16-ea
j  java.lang.invoke.MethodHandles.dropArguments0(Ljava/lang/invoke/MethodHandle;ILjava/util/List;)Ljava/lang/invoke/MethodHandle;+47 java.base@16-ea
j  java.lang.invoke.MethodHandles.dropArguments(Ljava/lang/invoke/MethodHandle;I[Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;+6 java.base@16-ea
j  java.lang.invoke.StringConcatFactory.generateMHInlineCopy(Ljava/lang/invoke/MethodType;Ljava/util/List;)Ljava/lang/invoke/MethodHandle;+266 java.base@16-ea
j  java.lang.invoke.StringConcatFactory.makeConcatWithConstants(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;+220 java.base@16-ea
j  java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+18 java.base@16-ea
j  java.lang.invoke.DelegatingMethodHandle$Holder.delegate(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+21 java.base@16-ea
j  java.lang.invoke.Invokers$Holder.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+26 java.base@16-ea
j  java.lang.invoke.BootstrapMethodInvoker.invoke(Ljava/lang/Class;Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+134 java.base@16-ea
j  java.lang.invoke.CallSite.makeSite(Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/invoke/CallSite;+8 java.base@16-ea
j  java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(Ljava/lang/Class;Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;+6 java.base@16-ea
j  java.lang.invoke.MethodHandleNatives.linkCallSite(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;+46 java.base@16-ea
v  ~StubRoutines::call_stub
j  IsModifiableClassAgent.premain(Ljava/lang/String;Ljava/lang/instrument/Instrumentation;)V+244
v  ~StubRoutines::call_stub
j  jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@16-ea
j  jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+146 java.base@16-ea
j  jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@16-ea
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@16-ea
j  sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V+180 java.instrument@16-ea
j  sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Ljava/lang/String;Ljava/lang/String;)V+6 java.instrument@16-ea
v  ~StubRoutines::call_stub