JDK-8251852 : 3 SA tests fail with "does not appear to be polymorphic" error
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • OS: os_x_10.15
  • CPU: x86_64
  • Submitted: 2020-08-15
  • Updated: 2023-08-02
  • Resolved: 2021-07-30
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
The following test failed in the JDK16 CI:

serviceability/sa/TestSysProps.java
serviceability/sa/ClhsdbJstackXcompStress.java
serviceability/sa/ClhsdbInspect.java

Here's a snippet from the TestSysProps.java log file:

----------System.err:(43/2606)----------


 stdout: [hsdb> hsdb> + verbose true
hsdb> + sysprops
];
 stderr: [Attaching to process 64961, please wait...
Exception in thread "main" java.lang.InternalError: Metadata does not appear to be polymorphic
	at jdk.hotspot.agent/sun.jvm.hotspot.types.basic.BasicTypeDataBase.findDynamicTypeForAddress(BasicTypeDataBase.java:279)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VirtualBaseConstructor.instantiateWrapperFor(VirtualBaseConstructor.java:104)
	at jdk.hotspot.agent/sun.jvm.hotspot.oops.Metadata.instantiateWrapperFor(Metadata.java:76)
	at jdk.hotspot.agent/sun.jvm.hotspot.memory.SystemDictionary.getSystemKlass(SystemDictionary.java:99)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VM.readSystemProperties(VM.java:1053)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VM.getSystemProperties(VM.java:1047)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.SysPropsDumper.run(SysPropsDumper.java:44)
	at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor$51.doit(CommandProcessor.java:1773)
	at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2051)
	at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:2021)
	at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.run(CommandProcessor.java:1901)
	at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:99)
	at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:40)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:280)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:483)
]
 exitValue = 1

java.lang.RuntimeException: Expected to get exit value of [0]

	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:457)
	at ClhsdbLauncher.runCmd(ClhsdbLauncher.java:142)
	at ClhsdbLauncher.run(ClhsdbLauncher.java:200)
	at TestSysProps.main(TestSysProps.java:127)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:832)

JavaTest Message: Test threw exception: java.lang.RuntimeException: Expected to get exit value of [0]

JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: Expected to get exit value of [0]
----------rerun:(43/7669)*----------


Here's a snippet from the ClhsdbJstackXcompStress.java log file:

----------System.err:(59/3875)----------
 stdout: [Attaching to process ID 64546, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 16-ea+12-426
Deadlock Detection:

No deadlocks found.

"main" #1 prio=5 tid=0x00007fee48809220 nid=0x2803 waiting on condition [0x0000700007994000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
   JavaThread state: _thread_blocked
];
 stderr: [java.lang.InternalError: CodeHeap does not appear to be polymorphic
	at jdk.hotspot.agent/sun.jvm.hotspot.types.basic.BasicTypeDataBase.findDynamicTypeForAddress(BasicTypeDataBase.java:279)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VirtualBaseConstructor.instantiateWrapperFor(VirtualBaseConstructor.java:104)
	at jdk.hotspot.agent/sun.jvm.hotspot.utilities.GrowableArray.at(GrowableArray.java:63)
	at jdk.hotspot.agent/sun.jvm.hotspot.code.CodeCache.contains(CodeCache.java:77)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VM.isJavaPCDbg(VM.java:903)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.amd64.AMD64CurrentFrameGuess.run(AMD64CurrentFrameGuess.java:194)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.bsd_amd64.BsdAMD64JavaThreadPDAccess.getCurrentFrameGuess(BsdAMD64JavaThreadPDAccess.java:101)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.JavaThread.getCurrentFrameGuess(JavaThread.java:268)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.JavaThread.getLastJavaVFrameDbg(JavaThread.java:230)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:81)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:45)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JStack.run(JStack.java:67)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:262)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:225)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JStack.runWithArgs(JStack.java:90)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJSTACK(SALauncher.java:300)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:483)
]
 exitValue = 1

java.lang.RuntimeException: stderr was not empty
	at jdk.test.lib.process.OutputAnalyzer.stderrShouldBeEmptyIgnoreVMWarnings(OutputAnalyzer.java:145)
	at ClhsdbJstackXcompStress.runJstackInLoop(ClhsdbJstackXcompStress.java:77)
	at ClhsdbJstackXcompStress.main(ClhsdbJstackXcompStress.java:100)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:832)
java.lang.RuntimeException: stderr was not empty
	at jdk.test.lib.process.OutputAnalyzer.stderrShouldBeEmptyIgnoreVMWarnings(OutputAnalyzer.java:145)
	at ClhsdbJstackXcompStress.runJstackInLoop(ClhsdbJstackXcompStress.java:77)
	at ClhsdbJstackXcompStress.main(ClhsdbJstackXcompStress.java:100)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:832)

JavaTest Message: Test threw exception: java.lang.RuntimeException: stderr was not empty
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: stderr was not empty
----------rerun:(43/7746)*----------
Comments
This hasn't reproduced since it turned up in two different test tasks on the Aug 25, 2020. I'm slightly suspicious that it was caused by JDK-8269830, which has now been fixed, but could also be due to JDK-8269838, which is very similar to JDK-8269830, but has not been fixed yet. In any case, closing for now as CNR.
30-07-2021

The error message is somewhat presumptive. It really just means we failed to lookup the vtable symbol. On OSX that means the "symbolicator" is failing to do the vtable symbol to address lookup. This appears to be the same bug as JDK-8248252, where the symbolicator on occasion can't lookup the vtable symbol of a Thread subclass. JDK-8248252 first appeared with OSX 10.15.5 and has now also been seen on 10.15.6. The issue reported in this bug is happening on 10.15.6.
31-08-2020