JDK-8322237 : Heap dump contains duplicate thread records for mounted virtual threads
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2023-12-15
  • Updated: 2024-07-25
  • Resolved: 2024-01-09
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 22 JDK 23
22Fixed 23 b05Fixed
Related Reports
Relates :  
Description
For mounted virtual threads HeapDumper dumps 2 HPROF_GC_ROOT_THREAD_OBJ subrecord.
One of them refers to actual stack trace/stack references, another one has empty stack trace.

test/hotspot/jtreg/serviceability/jvmti/vthread/HeapDump/VThreadInHeapDump.java output contains:
thread 0x8141dda0, 6 frames
  - [0] VThreadInHeapDumpTarg$VthreadMounted.run()V (VThreadInHeapDump.java:108)
      Java Local Reference: VThreadInHeapDumpTarg$VthreadMounted
      Java Local Reference: VThreadInHeapDumpTarg$VThreadMountedReferenced
  - [1] java.lang.Thread.runWith(Ljava/lang/Object;Ljava/lang/Runnable;)V (Thread.java:1583)
      Java Local Reference: java.lang.VirtualThread
      Java Local Reference: java.lang.Class
      Java Local Reference: VThreadInHeapDumpTarg$VthreadMounted
  - [2] java.lang.VirtualThread.run(Ljava/lang/Runnable;)V (VirtualThread.java:321)
      Java Local Reference: java.lang.VirtualThread
      Java Local Reference: VThreadInHeapDumpTarg$VthreadMounted
      Java Local Reference: java.lang.Class
  - [3] java.lang.VirtualThread$VThreadContinuation$1.run()V (VirtualThread.java:201)
      Java Local Reference: java.lang.VirtualThread$VThreadContinuation$1
  - [4] jdk.internal.vm.Continuation.enter0()V (Continuation.java:320)
      Java Local Reference: java.lang.VirtualThread$VThreadContinuation
  - [5] jdk.internal.vm.Continuation.enter(Ljdk/internal/vm/Continuation;Z)V (Continuation.java:312)
      Java Local Reference: java.lang.VirtualThread$VThreadContinuation
...
thread 0x8141dda0, 0 frames

Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk22/pull/60 Date: 2024-01-11 00:59:08 +0000
11-01-2024

Changeset: dd8ae616 Author: Alex Menkov <amenkov@openjdk.org> Date: 2024-01-09 19:31:03 +0000 URL: https://git.openjdk.org/jdk/commit/dd8ae616437398f957f9b4f09cf2c7f1d0bd0938
09-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17134 Date: 2023-12-16 02:15:16 +0000
18-12-2023