JDK-8360312 : Serviceability Agent tests fail with JFR enabled due to unknown thread type JfrRecorderThread
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-06-24
  • Updated: 2025-07-17
  • Resolved: 2025-06-27
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 25 JDK 26
25Fixed 26 b05Fixed
Related Reports
Causes :  
Description
Whilst running hs-tier1 tests with JFR enabled I discovered that the SA doesn't seem to work with JFR enabled:

java.lang.RuntimeException: Unable to deduce type of thread from address 0x00007fce98ee7ee0 (expected type JavaThread, CompilerThread, MonitorDeflationThread, AttachListenerThread, DeoptimizeObjectsALotThread, StringDedupThread, NotificationThread, ServiceThread or JvmtiAgentThread)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.Threads.createJavaThreadWrapper(Threads.java:196)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.Threads.getJavaThreadAt(Threads.java:178)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.DeadlockDetector.createThreadTable(DeadlockDetector.java:149)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.DeadlockDetector.print(DeadlockDetector.java:56)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.DeadlockDetector.print(DeadlockDetector.java:39)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:62)
	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:278)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:241)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:134)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JStack.runWithArgs(JStack.java:90)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJSTACK(SALauncher.java:306)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:507)
Caused by: sun.jvm.hotspot.types.WrongTypeException: No suitable match for type of address 0x00007fce98ee7ee0 (nearest symbol is _ZTV17JfrRecorderThread)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.InstanceConstructor.newWrongTypeException(InstanceConstructor.java:62)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VirtualConstructor.instantiateWrapperFor(VirtualConstructor.java:80)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.Threads.createJavaThreadWrapper(Threads.java:192)

The SA needs to be aware of every type of JavaThread that the VM can create, but is missing an entry for JfrRecorderThread in open/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java

JDK-8352251 made the JfrRecorderThread an actual JavaThread subclass, but did not update the SA.
Comments
A pull request was submitted for review. Branch: jdk25 URL: https://git.openjdk.org/jdk/pull/26198 Date: 2025-07-08 17:57:40 +0000
08-07-2025

Changeset: 712d866b Branch: master Author: Chris Plummer <cjplummer@openjdk.org> Date: 2025-06-27 17:19:22 +0000 URL: https://git.openjdk.org/jdk/commit/712d866b72b43c839c57c3303dfb215f94c0db3b
27-06-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25960 Date: 2025-06-24 21:15:06 +0000
25-06-2025

Reproduced with the following: make test TEST=serviceability/sa/ TEST_VM_OPTS=-XX:StartFlightRecording Note there is also a different issue with serviceability/sa/ClhsdbJstackWithConcurrentLock. It fails because it launches LingeredApp with -Xmx4m, which is too small when JFR is enabled. [1.581s][error][jfr,startup] Java heap space Error occurred during initialization of VM Failure when starting JFR on_create_vm_3
24-06-2025