JDK-8371755 : Test java/lang/instrument/DaemonThread/TestDaemonThread.java failed
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.instrument
  • Affected Version: 26
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2025-11-13
  • Updated: 2025-11-24
  • Resolved: 2025-11-24
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 26
26Resolved
Related Reports
Causes :  
Duplicate :  
Description
It seems the recent changes to the GC shutdown protocol are causing this test failure:

---------System.err:(18/1540)----------
 stdout: [file:/opt/mach5/mesos/work_dir/slaves/526fbd26-20de-495c-9a19-a04adc16f7d1-S22906/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/65b1402a-fb28-4dcf-83c7-ac6ea5805c80/runs/422e448c-c666-4710-8336-702cbd24d2c6/testoutput/test-support/jtreg_open_test_jdk_jdk_instrument/classes/2/java/lang/instrument/DaemonThread/TestDaemonThread.d/
[2.557s][warning][gc,alloc] Thread-0: Stall for VM-Shutdown timed out; allocation may fail with OOME
];
 stderr: [*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message can't create byte array at /opt/mach5/mesos/work_dir/slaves/526fbd26-20de-495c-9a19-a04adc16f7d1-S26951/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/c247149c-5ad6-4c23-a416-e28b5e77a2fc/runs/9cf167de-43a3-4487-881a-1a1cff83efeb/workspace/open/src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 844
]
 exitValue = 0

java.lang.RuntimeException: 'ASSERTION FAILED' found in stderr
	at jdk.test.lib.process.OutputAnalyzer.shouldNotContain(OutputAnalyzer.java:303)
	at TestDaemonThreadLauncher.main(TestDaemonThreadLauncher.java:34)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335)
	at java.base/java.lang.Thread.run(Thread.java:1474)


It looks like the allocation does now fail with OOME.
Comments
The problem might happen if GC stops before event is posted. Closing as a dup of JDK-8367902
21-11-2025

Since VM doesn't "stall", the impact is low, just failing test. So it is P4 rather then P2.
19-11-2025

The test tries to run some work and thus provoking memory allocation in the daemon thread after shutdown intentionally. Let just ignore this particular message,
19-11-2025

This warning was introduced by JDK-8366865
19-11-2025

The problem happens when instrumentation agent tries to allocate memory after GC is in shutdown. The behaviour looks like expected. It can't allocate memory, failed with OOME.
19-11-2025

ILW=MHH=P2
18-11-2025