JDK-8307451 : jhsdb jstack assertion failure on virtual threads
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 21
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-05-04
  • Updated: 2023-05-04
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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Spotted on a personal mach5 job when running failure handlers on a test that timed out because of virtual thread deadlock.

Example output for a single thread:
"ForkJoinPool-1-worker-4" #35 daemon prio=5 tid=0x0000fffb3c003fb0 nid=3980773 waiting for monitor entry [0x0000fffba07fd000]
   java.lang.Thread.State: BLOCKED (on object monitor)
   JavaThread state: _thread_blocked
 - jdk.internal.net.http.Http2Connection.sendFrame(jdk.internal.net.http.frame.Http2Frame) @bci=12, line=1387 (Interpreted frame)
	- waiting to lock <0x00000000d0b09408> (a java.lang.Object)
 - jdk.internal.net.http.Stream.sendHeadersAsync() @bci=145, line=838 (Interpreted frame)
 - jdk.internal.net.http.Exchange.lambda$responseAsyncImpl0$8(java.util.function.Function, jdk.internal.net.http.ExchangeImpl) @bci=1, line=550 (Interpreted frame)
 - jdk.internal.net.http.Exchange$$Lambda+0x000000080111f608.apply(java.lang.Object) @bci=12 (Interpreted frame)
 - jdk.internal.net.http.Exchange.checkFor407(jdk.internal.net.http.ExchangeImpl, java.lang.Throwable, java.util.function.Function) @bci=172, line=430 (Interpreted frame)
 - jdk.internal.net.http.Exchange.lambda$responseAsyncImpl0$9(java.util.function.Function, jdk.internal.net.http.ExchangeImpl, java.lang.Throwable) @bci=4, line=554 (Interpreted frame)
 - jdk.internal.net.http.Exchange$$Lambda+0x000000080112c910.apply(java.lang.Object, java.lang.Object) @bci=16 (Interpreted frame)
 - java.util.concurrent.CompletableFuture.uniHandle(java.lang.Object, java.util.function.BiFunction, java.util.concurrent.CompletableFuture$UniHandle) @bci=58, line=934 (Interpreted frame)
 - java.util.concurrent.CompletableFuture.uniHandleStage(java.util.concurrent.Executor, java.util.function.BiFunction) @bci=54, line=950 (Interpreted frame)
 - java.util.concurrent.CompletableFuture.handle(java.util.function.BiFunction) @bci=3, line=2372 (Interpreted frame)
 - jdk.internal.net.http.Exchange.responseAsyncImpl0(jdk.internal.net.http.HttpConnection) @bci=75, line=554 (Interpreted frame)

Error occurred during stack walking:
sun.jvm.hotspot.utilities.AssertionFailure: must have non-zero frame size
	at jdk.hotspot.agent/sun.jvm.hotspot.utilities.Assert.that(Assert.java:32)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.aarch64.AARCH64Frame.senderForCompiledFrame(AARCH64Frame.java:395)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.aarch64.AARCH64Frame.sender(AARCH64Frame.java:295)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.Frame.sender(Frame.java:207)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.Frame.realSender(Frame.java:212)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VFrame.sender(VFrame.java:119)
	at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VFrame.javaSender(VFrame.java:148)
	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: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:302)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:500)

The assertion may affect some or all virtual threads. If multiple threads have the same stack trace, some may observe the assertion failure and others may not. Multiple jstack runs on the same deadlocked process consistently trigger assertion failures on the same threads.