JDK-8311993 : Test serviceability/sa/UniqueVtableTest.java failed: duplicate vtables detected
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 21,23,24
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2023-07-13
  • Updated: 2024-09-10
  • Resolved: 2024-09-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 b14Fixed
Related Reports
Relates :  
Description
total: 887, vm_classes_with_vtable: 536, vm_classes_without_vtable: 188
Duplicate vtable: 0x00007ffd2333ecc8: 
  - ciInstanceKlass* (extends null)
  - ciInstanceKlass (extends ciKlass)
Duplicate vtable: 0x00007ffd233ba4f0: 
  - GenCollectedHeap (extends CollectedHeap)
  - GenCollectedHeap* (extends null)
Duplicate vtable: 0x00007ffd2346f4d8: 
  - MethodCounters* (extends null)
  - MethodCounters (extends MetaspaceObj)
Duplicate vtable: 0x00007ffd2349e4d8: 
  - PSOldGen* (extends null)
  - PSOldGen (extends null)
Duplicate vtable: 0x00007ffd234b58d8: 
  - TenuredSpace* (extends null)
  - TenuredSpace (extends ContiguousSpace)
Duplicate vtable: 0x00007ffd233518b8: 
  - RuntimeBlob* (extends null)
  - RuntimeBlob (extends CodeBlob)
Duplicate vtable: 0x00007ffd23342840: 
  - ciObject* (extends null)
  - ciObject (extends ciBaseObject)
Duplicate vtable: 0x00007ffd23358c60: 
  - CollectedHeap* (extends null)
  - CollectedHeap (extends null)
Duplicate vtable: 0x00007ffd23372078: 
  - InstanceKlass (extends Klass)
  - InstanceKlass* (extends null)
Duplicate vtable: 0x00007ffd23335870: 
  - CardTableRS* (extends null)
  - CardTableRS (extends CardTable)
Duplicate vtable: 0x00007ffd23491460: 
  - ParallelScavengeHeap (extends CollectedHeap)
  - ParallelScavengeHeap* (extends null)
Duplicate vtable: 0x00007ffd232fbd88: 
  - InlineTree* (extends null)
  - InlineTree (extends null)
Duplicate vtable: 0x00007ffd23344da0: 
  - ciSymbol (extends null)
  - ciSymbol* (extends null)
Duplicate vtable: 0x00007ffd2333f548: 
  - ciKlass* (extends null)
  - ciKlass (extends ciType)
Duplicate vtable: 0x00007ffd23367938: 
  - ConstantPool* (extends null)
  - ConstantPool (extends Metadata)
Duplicate vtable: 0x00007ffd234a7540: 
  - PhaseRegAlloc (extends Phase)
  - PhaseRegAlloc* (extends null)
Duplicate vtable: 0x00007ffd23351d30: 
  - DeoptimizationBlob (extends SingletonBlob)
  - DeoptimizationBlob* (extends null)
Duplicate vtable: 0x00007ffd2339bed0: 
  - G1CollectedHeap* (extends null)
  - G1CollectedHeap (extends CollectedHeap)
Duplicate vtable: 0x00007ffd2335baf8: 
  - RootNode* (extends null)
  - RootNode (extends LoopNode)
Duplicate vtable: 0x00007ffd2346f6c8: 
  - MethodData* (extends null)
  - MethodData (extends Metadata)
Duplicate vtable: 0x00007ffd234a3230: 
  - PSYoungGen (extends null)
  - PSYoungGen* (extends null)
Duplicate vtable: 0x00007ffd232ec248: 
  - SafePointNode* (extends null)
  - SafePointNode (extends MultiNode)
Duplicate vtable: 0x00007ffd23372270: 
  - ObjArrayKlass* (extends null)
  - ObjArrayKlass (extends ArrayKlass)
Duplicate vtable: 0x00007ffd234a2e40: 
  - PSVirtualSpace (extends null)
  - PSVirtualSpace* (extends null)
Duplicate vtable: 0x00007ffd233757c8: 
  - DefNewGeneration* (extends null)
  - DefNewGeneration (extends Generation)
Duplicate vtable: 0x00007ffd233633d8: 
  - CompiledMethod (extends CodeBlob)
  - CompiledMethod* (extends null)
Duplicate vtable: 0x00007ffd234d3fa8: 
  - TenuredGeneration* (extends null)
  - TenuredGeneration (extends Generation)
Duplicate vtable: 0x00007ffd23351bf0: 
  - RuntimeStub (extends RuntimeBlob)
  - RuntimeStub* (extends null)
Duplicate vtable: 0x00007ffd2333fb20: 
  - ciMetadata (extends ciBaseObject)
  - ciMetadata* (extends null)
];
 stderr: [Exception in thread "main" java.lang.RuntimeException: Duplicate vtable(s) found: 29
	at UniqueVtableTest.runTest(UniqueVtableTest.java:143)
	at UniqueVtableTest.runTest(UniqueVtableTest.java:73)
	at UniqueVtableTest.main(UniqueVtableTest.java:196)
]
 exitValue = 1

Comments
Changeset: a7120e2b Branch: master Author: Alex Menkov <amenkov@openjdk.org> Date: 2024-09-03 19:06:10 +0000 URL: https://git.openjdk.org/jdk/commit/a7120e2b251e1337df5bd4a2808638d28b7d3bd3
03-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20684 Date: 2024-08-22 19:50:01 +0000
22-08-2024

Research/debugging shown that IDebugSymbols::GetOffsetByName() sometimes returns offset for both class and class pointer types; The behavior is intermittent (the method can return success for some classes, but then fail for others in the same process). On Windows VtblAccess always looks for decorated symbols like "??_7" + type_name + "@@6B@" (for example for "CollectedHeap" it looks for "??_7CollectedHeap@@6B@", for "CollectedHeap*" it looks for "??_7CollectedHeap*@@6B@"). SYMOPT_UNDNAME option is off for IDebugSymbols::GetOffsetByName() and MSDN says the method does not support wildcards, so it's expected the method fails for both symbols (and vtable value is found from DLL exported symbols). This IDebugSymbols::GetOffsetByName() behavior occurs with other SA tests, on both release and debug binaries, with and without .pdb files set by IDebugSymbols::SetSymbolPath. Only UniqueVtableTest fails as GetOffsetByName returns the same values for class and class pointer types. Returned offset corresponds to symbols like jvm!CollectedHeap::`vftable'.
22-08-2024

Spotted in jdk-24+10-1008-tier3: serviceability/sa/UniqueVtableTest.java https://mach5.us.oracle.com/mdash/jobs/mach5-one-jdk-24+10-1008-tier3-20240803-0004-14818141/results?search=status%3Afailed+AND+-state%3Ainvalid https://mach5.us.oracle.com:10060/api/v1/results/mach5-one-jdk-24+10-1008-tier3-20240803-0004-14818141-tier3-rt-LegacyLocking-tier1_serviceability-windows-x64-debug-404-1722645285-312/log
05-08-2024

The issue is lookupSymbol for pointers sometimes returns the same address as for Class (it expected to return null). Number of the bad entries vary from 2 to 29 lookupSymbol on Windows performs: 1. calls IDebugSymbols::GetOffsetByName() 2. (if GetOffsetByName returned null), search through exported symbols from jvm.dll (using coff library) DLL from failed builds don't contain exports for pointer types, so most likely IDebugSymbols::GetOffsetByName() is succeeded for the symbol. Tried to reproduce the issue locally using binaries and symbol files from failed tasks, the issue is not reproducible.
03-08-2024

Only windows-x64-debug is affected
26-07-2024

[2024-02-05T23:31:31.299296500Z] Gathering output for process 48104 [2024-02-05T23:31:31.418122800Z] Waiting for completion for process 48104 Timeout signalled after 480 seconds [2024-02-05T23:44:20.590270200Z] Waiting for completion finished for process 48104 Output and diagnostic info for process 48104 was saved into 'pid-48104-output.log' LingeredApp stdout: [[770.376s][error][attach] could not open (2) pipe \\\\.\\pipe\\javatool-1471710471 to send result of operation jcmd [770.376s][error][attach] could not open (2) pipe \\\\.\\pipe\\javatool-1553546734 to send result of operation jcmd [770.376s][error][attach] could not open (2) pipe \\\\.\\pipe\\javatool559591373 to send result of operation jcmd ]; LingeredApp stderr: [] LingeredApp exitValue = 0 ----------System.err:(294/13896)---------- stdout: [Attaching to process ID 49540... Attached successfully. vtable is null for JNIHandleBlock (extends null) vtable is null for Abstract_VM_Version (extends null) vtable is null for JVMState (extends null) vtable is null for GrowableArray<InlineTree*> (extends null) vtable is null for JvmtiExport (extends null) vtable is null for Generation::StatRecord (extends null) vtable is null for CardTable*const (extends null) vtable is null for ZAttachedArrayForForwarding (extends null) vtable is null for CheckedExceptionElement (extends null) vtable is null for MethodParametersElement (extends null) vtable is null for address (extends null) vtable is null for ClassLoaderDataGraph (extends null) vtable is null for ZHeap (extends null) vtable is null for ciField (extends null) vtable is null for PerfMemory (extends null) vtable is null for CompressedWriteStream (extends null) vtable is null for XGranuleMapForPageTable (extends null) vtable is null for PcDescCache (extends null) vtable is null for ciObjectFactory (extends null) vtable is null for Array<ResolvedIndyEntry> (extends MetaspaceObj) vtable is null for FileMapInfo (extends CHeapObj<mtInternal>) vtable is null for PerfDataEntry (extends null) vtable is null for GrowableArray<CodeHeap*> (extends null) vtable is null for ObjectSynchronizer (extends null) vtable is null for LockStack (extends null) vtable is null for SystemDictionary (extends null) vtable is null for XForwarding (extends null) vtable is null for HeapBlock::Header (extends null) vtable is null for Threads (extends null) vtable is null for Annotations (extends MetaspaceObj) vtable is null for XGranuleMapForForwarding (extends null) vtable is null for SATBMarkQueue (extends null) vtable is null for MemRegion (extends null) vtable is null for Arena (extends null) vtable is null for StubRoutines (extends null) vtable is null for volatile Metadata (extends null) vtable is null for ExceptionTableElement (extends null) vtable is null for ResolvedFieldEntry (extends null) vtable is null for zoffset (extends null) vtable is null for Array<ResolvedFieldEntry> (extends MetaspaceObj) vtable is null for HeapRegionManager (extends null) vtable is null for NegLNode (extends NegNode) vtable is null for void (extends null) vtable is null for SerialBlockOffsetSharedArray (extends null) vtable is null for CHeapObj<mtInternal> (extends null) vtable is null for StubQueue (extends null) vtable is null for XPageTable (extends null) vtable is null for <opaque> (extends null) vtable is null for Compile (extends null) vtable is null for GrowableArray<int> (extends null) vtable is null for MethodData::CompilerCounters (extends null) vtable is null for SerialBlockOffsetTable (extends null) vtable is null for HeapRegionType (extends null) vtable is null for ZPageTable (extends null) vtable is null for JVMFlag (extends null) vtable is null for PerfDataPrologue (extends null) vtable is null for Block_Array (extends null) vtable is null for HeapRegion (extends null) vtable is null for OopMapValue (extends null) vtable is null for LocalVariableTableElement (extends null) vtable is null for VectorMaskWrapperNode (extends VectorNode) vtable is null for XHeap (extends null) vtable is null for XForwardingEntry (extends null) vtable is null for ConstMethod (extends MetaspaceObj) vtable is null for VMReg (extends null) vtable is null for ZPageAllocator (extends null) vtable is null for oopDesc (extends null) vtable is null for Runtime1 (extends null) vtable is null for AdapterHandlerEntry (extends null) vtable is null for CompressedOops (extends null) vtable is null for jniIdMapBase (extends null) vtable is null for Array<u2> (extends MetaspaceObj) vtable is null for PtrQueue (extends null) vtable is null for XGlobalsForVMStructs (extends null) vtable is null for XAttachedArrayForForwarding (extends null) vtable is null for NegINode (extends NegNode) vtable is null for Array<u1> (extends MetaspaceObj) vtable is null for G1DirtyCardQueue (extends null) vtable is null for ZForwardingEntry (extends null) vtable is null for JNIid (extends null) vtable is null for OSThread (extends null) vtable is null for ImmutableOopMapSet (extends null) vtable is null for CompressedStream (extends null) vtable is null for BitMap (extends null) vtable is null for JavaCallWrapper (extends null) vtable is null for ImmutableOopMapPair (extends null) vtable is null for XPageAllocator (extends null) vtable is null for JavaFrameAnchor (extends null) vtable is null for CompressedKlassPointers (extends null) vtable is null for OopStorage (extends null) vtable is null for Array<Klass*> (extends MetaspaceObj) vtable is null for Array<InstanceKlass*> (extends null) vtable is null for ThreadsList (extends null) vtable is null for ciConstant (extends null) vtable is null for OopHandle (extends null) vtable is null for G1MonitoringSupport (extends null) vtable is null for vtableEntry (extends null) vtable is null for ClassLoaderData (extends null) vtable is null for BasicLock (extends null) vtable is null for HeapWord* volatile (extends null) vtable is null for BasicObjectLock (extends null) vtable is null for ZPhysicalMemoryManager (extends null) vtable is null for ResolvedIndyEntry (extends null) vtable is null for ExceptionCache (extends null) vtable is null for HeapBlock (extends null) vtable is null for XRelocate (extends null) vtable is null for CDSFileMapRegion (extends null) vtable is null for BarrierSet::Name (extends null) vtable is null for frame (extends null) vtable is null for MetaspaceObj (extends null) vtable is null for elapsedTimer (extends null) vtable is null for Stub (extends null) vtable is null for Universe (extends null) vtable is null for AbstractInterpreter (extends null) vtable is null for zoffset_end (extends null) vtable is null for Mutex (extends null) vtable is null for VMError (extends null) vtable is null for SharedRuntime (extends null) vtable is null for HeapWord (extends null) vtable is null for ImmutableOopMap (extends null) vtable is null for Array<int> (extends MetaspaceObj) vtable is null for PcDesc (extends null) vtable is null for FreeBlock (extends HeapBlock) vtable is null for ZVirtualMemory (extends null) vtable is null for BreakpointInfo (extends null) vtable is null for XForwardingTable (extends null) vtable is null for MonitorList (extends null) vtable is null for ObjectMonitor (extends null) vtable is null for CodeHeap (extends null) vtable is null for ZForwarding (extends null) vtable is null for GrowableArray<ciMetadata*> (extends null) vtable is null for ZGranuleMapForPageTable (extends null) vtable is null for VirtualSpace (extends null) vtable is null for GrowableArray<ciSymbol*> (extends null) vtable is null for Phase (extends null) vtable is null for Symbol (extends null) vtable is null for java_lang_Class (extends null) vtable is null for JNIHandles (extends null) vtable is null for jmethodID (extends null) vtable is null for os (extends null) vtable is null for vmClasses (extends null) vtable is null for ThreadsSMRSupport (extends null) vtable is null for OptoRegPair (extends null) vtable is null for CompileTask (extends null) vtable is null for Array<ResolvedMethodEntry> (extends MetaspaceObj) vtable is null for instanceOopDesc (extends oopDesc) vtable is null for ThreadLocalAllocBuffer (extends null) vtable is null for ZRelocate (extends null) vtable is null for Block_List (extends Block_Array) vtable is null for vframeArray (extends null) vtable is null for Array<Array<u1>*> (extends MetaspaceObj) vtable is null for arrayOopDesc (extends oopDesc) vtable is null for BitMapView (extends BitMap) vtable is null for ZForwardingTable (extends null) vtable is null for DataLayout (extends null) vtable is null for JavaThread *const *const (extends null) vtable is null for jobject (extends null) vtable is null for Dependencies (extends null) vtable is null for AtanDNode (extends Node) vtable is null for vmSymbols (extends null) vtable is null for Array<jushort> (extends null) vtable is null for Options (extends null) vtable is null for InterpreterCodelet (extends Stub) vtable is null for PhaseCFG (extends Phase) vtable is null for ResourceArea (extends Arena) vtable is null for ciEnv (extends null) vtable is null for ZPage (extends null) vtable is null for Arguments (extends null) vtable is null for objArrayOopDesc (extends arrayOopDesc) vtable is null for volatile unsigned char (extends null) vtable is null for Deoptimization::UnrollBlock (extends null) vtable is null for OopMapCache (extends null) vtable is null for BarrierSet::FakeRtti (extends null) vtable is null for XVirtualMemory (extends null) vtable is null for VMRegImpl (extends null) vtable is null for ZGlobalsForVMStructs (extends null) vtable is null for ResolvedMethodEntry (extends null) vtable is null for Deoptimization (extends null) vtable is null for XPhysicalMemoryManager (extends null) vtable is null for Array<Method*> (extends MetaspaceObj) vtable is null for FileMapHeader (extends null) vtable is null for ConstantPoolCache (extends MetaspaceObj) vtable is null for ZPageType (extends null) vtable is null for CodeCache (extends null) vtable is null for CompiledICHolder (extends null) vtable is null for AgeTable (extends null) vtable is null for CardTable::CardValue (extends null) vtable is null for ZGranuleMapForForwarding (extends null) vtable is null for narrowKlass (extends null) vtable is null for XPage (extends null) vtable is null for vframeArrayElement (extends null) total: 881, vm_classes_with_vtable: 525, vm_classes_without_vtable: 191 Duplicate vtable: 0x00007ffedca6bf58: - DefNewGeneration* (extends null) - DefNewGeneration (extends Generation) Duplicate vtable: 0x00007ffedca5db50: - ConstantPool* (extends null) - ConstantPool (extends Metadata) Duplicate vtable: 0x00007ffedca373d8: - ciObject* (extends null) - ciObject (extends ciBaseObject) Duplicate vtable: 0x00007ffedc9def90: - ArrayKlass* (extends null) - ArrayKlass (extends Klass) Duplicate vtable: 0x00007ffedcac1648: - InstanceKlass (extends Klass) - InstanceKlass* (extends null) Duplicate vtable: 0x00007ffedcb97e68: - PSOldGen* (extends null) - PSOldGen (extends null) Duplicate vtable: 0x00007ffedca92e60: - G1CollectedHeap* (extends null) - G1CollectedHeap (extends CollectedHeap) Duplicate vtable: 0x00007ffedcb9ca78: - PSYoungGen (extends null) - PSYoungGen* (extends null) Duplicate vtable: 0x00007ffedcb69688: - MethodData* (extends null) - MethodData (extends Metadata) Duplicate vtable: 0x00007ffedcb9c680: - PSVirtualSpace (extends null) - PSVirtualSpace* (extends null) Duplicate vtable: 0x00007ffedca68ab8: - ObjArrayKlass* (extends null) - ObjArrayKlass (extends ArrayKlass) Duplicate vtable: 0x00007ffedca346b8: - ciMetadata (extends ciBaseObject) - ciMetadata* (extends null) Duplicate vtable: 0x00007ffedca39958: - ciSymbol (extends null) - ciSymbol* (extends null) Duplicate vtable: 0x00007ffedcb8b940: - ParallelScavengeHeap (extends CollectedHeap) - ParallelScavengeHeap* (extends null) Duplicate vtable: 0x00007ffedc9f1148: - InlineTree* (extends null) - InlineTree (extends null) Duplicate vtable: 0x00007ffedca33910: - ciInstanceKlass* (extends null) - ciInstanceKlass (extends ciKlass) Duplicate vtable: 0x00007ffedca2a500: - CardTableRS* (extends null) - CardTableRS (extends CardTable) Duplicate vtable: 0x00007ffedcba0d20: - PhaseRegAlloc (extends Phase) - PhaseRegAlloc* (extends null) Duplicate vtable: 0x00007ffedca4dd20: - CollectedHeap* (extends null) - CollectedHeap (extends null) Duplicate vtable: 0x00007ffedcbaeda8: - TenuredSpace* (extends null) - TenuredSpace (extends ContiguousSpace) Duplicate vtable: 0x00007ffedca341a0: - ciKlass* (extends null) - ciKlass (extends ciType) Duplicate vtable: 0x00007ffedca468c8: - RuntimeBlob* (extends null) - RuntimeBlob (extends CodeBlob) Duplicate vtable: 0x00007ffedca514e8: - RootNode* (extends null) - RootNode (extends LoopNode) Duplicate vtable: 0x00007ffedc9e0cd8: - SafePointNode* (extends null) - SafePointNode (extends MultiNode) Duplicate vtable: 0x00007ffedcb69490: - MethodCounters* (extends null) - MethodCounters (extends MetaspaceObj) Duplicate vtable: 0x00007ffedca590b8: - CompiledMethod (extends CodeBlob) - CompiledMethod* (extends null) ]; stderr: [Exception in thread "main" java.lang.RuntimeException: Duplicate vtable(s) found: 26 at UniqueVtableTest.runTest(UniqueVtableTest.java:143) at UniqueVtableTest.runTest(UniqueVtableTest.java:73) at UniqueVtableTest.main(UniqueVtableTest.java:196) ] exitValue = 1
06-02-2024

Test fails with light-weight locking -XX:+UnlockExperimentalVMOptions \\ -XX:LockingMode=2 \\
13-07-2023