JDK-8261603 : vmTestbase/nsk/jvmti/AttachOnDemand/attach024/TestDescription.java failed with "non-zero code -1073741819"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 17
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux,windows
  • CPU: x86_64
  • Submitted: 2021-02-11
  • Updated: 2025-01-20
  • Resolved: 2025-01-17
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 20
20Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The following test failed in the JDK17 CI:

vmTestbase/nsk/jvmti/AttachOnDemand/attach024/TestDescription.java

Here's a snippet from the log file:

#section:main
----------messages:(4/801)*----------
command: main nsk.share.aod.AODTestRunner -jdk c:\\ade\\mesos\\work_dir\\jib-master\\install\\jdk-17+9-654\\windows-x64-debug.jdk\\jdk-17\\fastdebug -javaOpts="--add-reads java.base=ALL-UNNAMED -XX:+UsePerfData -XX:MaxRAMPercentage=4 -Djava.io.tmpdir=t:\\testoutput\\test-support\\jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jvmti_quick\\tmp -XX:StartFlightRecording=dumponexit=true" -target nsk.share.aod.TargetApplicationWaitingAgents -ja attach024Agent00.jar
reason: User specified action: run main/othervm nsk.share.aod.AODTestRunner -jdk ${test.jdk} -javaOpts="--add-reads java.base=ALL-UNNAMED -XX:+UsePerfData ${test.vm.opts} ${test.java.opts}" -target nsk.share.aod.TargetApplicationWaitingAgents -ja attach024Agent00.jar 
Mode: othervm [/othervm specified]
elapsed time (seconds): 11.73
----------configuration:(0/0)----------
----------System.out:(25/1841)*----------
Started recording 1. No limit specified, using maxsize=250MB as default.

Use jcmd 22284 JFR.dump name=1 filename=FILEPATH to copy recording data to file.
Starting target application: c:\\ade\\mesos\\work_dir\\jib-master\\install\\jdk-17+9-654\\windows-x64-debug.jdk\\jdk-17\\fastdebug\\bin\\java -Dvmsqe.aod.AppId=22284 --add-reads java.base=ALL-UNNAMED -XX:+UsePerfData -XX:MaxRAMPercentage=4 -Djava.io.tmpdir=t:\\testoutput\\test-support\\jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jvmti_quick\\tmp -XX:StartFlightRecording=dumponexit=true -XX:+EnableDynamicAgentLoading nsk.share.aod.TargetApplicationWaitingAgents -agentsNumber 1 -port 1139
TargetApp (stdout): Started recording 1. No limit specified, using maxsize=250MB as default.
TargetApp (stdout): 
TargetApp (stdout): Use jcmd 12072 JFR.dump name=1 filename=FILEPATH to copy recording data to file.
TargetApp (stdout): Sending signal 'ready'
TargetApp (stdout): Waiting for agents connection
Signal received: 'ready'
Target VM id was identified: 12072
Trying to get VirtualMachine object
VirtualMachine was created: sun.tools.attach.AttachProviderImpl@30e1e79b: 12072
Trying to load jar agent: 'attach024Agent00.jar' (agent options: '-agentName=JarAgent-0')
TargetApp (stdout): Agent 'JarAgent-0' was loaded
TargetApp (stdout): All expected agents connected
TargetApp (stdout): Waiting for agents finishing
Agent was loaded
Detaching from the VM 'sun.tools.attach.AttachProviderImpl@30e1e79b: 12072'
Sending signal: 'finish'
TargetApp (stdout): JarAgent-0: TooManyListenersException.toString(): java.util.TooManyListenersException: Test
TargetApp (stdout): Agent 'JarAgent-0' finished execution (finishedSuccessfully: true)
TargetApp (stdout): All agents finished execution
TargetApp (stdout): Signal received: 'finish'
TargetApp (stdout): Test passed
----------System.err:(14/982)----------
nsk.share.Failure: Target application finished with non-zero code -1073741819
	at nsk.share.aod.AODTestRunner.runTest(AODTestRunner.java:153)
	at nsk.share.aod.AODTestRunner.main(AODTestRunner.java:184)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:831)

JavaTest Message: Test threw exception: nsk.share.Failure: Target application finished with non-zero code -1073741819
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: nsk.share.Failure: Target application finished with non-zero code -1073741819
----------rerun:(39/7099)*----------

The test ended with "TargetApp (stdout): Test passed" so it looks like
the test passed, but then it exited with non-zero code -1073741819.

The test task has the following JVM args:

-XX:StartFlightRecording=dumponexit=true

so I'm wondering if something happened with JFR...
Comments
It looks fine as far as I can see. All events can be parsed and the size in the file header matches the file size (227657). It also has finalChunk=true, which is only set if the JVM was able to write the whole file. $ jfr -J-Xlog:jfr+system+parser=info summary hotspot-pid-47116-id-1-2021_08_22_15_21_05.jfr [0.029s][info][jfr,system,parser] Chunk: 0 [0.029s][info][jfr,system,parser] Chunk: file=/Users/erik/hotspot-pid-47116-id-1-2021_08_22_15_21_05.jfr [0.029s][info][jfr,system,parser] Chunk: startPosition=0 [0.029s][info][jfr,system,parser] Chunk: major=2 [0.029s][info][jfr,system,parser] Chunk: minor=1 [0.029s][info][jfr,system,parser] Chunk: chunkSize=227657 [0.029s][info][jfr,system,parser] Chunk: constantPoolPosition=227562 [0.029s][info][jfr,system,parser] Chunk: metadataPosition=136030 [0.029s][info][jfr,system,parser] Chunk: startNanos=1629645664508721800 [0.029s][info][jfr,system,parser] Chunk: durationNanos=1431756100 [0.029s][info][jfr,system,parser] Chunk: startTicks=240552872 [0.029s][info][jfr,system,parser] Chunk: ticksPerSecond=100000000 [0.029s][info][jfr,system,parser] Setting input size to 227657 [0.029s][info][jfr,system,parser] Chunk: chunkSize=227657 [0.029s][info][jfr,system,parser] Chunk: constantPoolPosition=227562 [0.029s][info][jfr,system,parser] Chunk: metadataPosition=136030 [0.029s][info][jfr,system,parser] Chunk: durationNanos =1431756100 [0.029s][info][jfr,system,parser] Chunk: generation=0 [0.029s][info][jfr,system,parser] Chunk: finished=true [0.029s][info][jfr,system,parser] Chunk: fileSize=227657 [0.029s][info][jfr,system,parser] Chunk: finalChunk=true
23-06-2022

Hmmm, however, the JFR file created in the jdk-18+12-581-tier7 failure ( https://bugs.openjdk.java.net/secure/attachment/96380/hotspot-pid-47116-id-1-2021_08_22_15_21_05.jfr ) seems to be OK. I can open it using JMC. Could someone in JFR team check if this JFR file has been completely written? See attachment.
08-09-2021

From the log (jdk-18+12-581-tier7), it looks like the Java app has indeed finished. Maybe during the writing of the JFR file (with -XX:StartFlightRecording=dumponexit=true) is crashing? To diagnose this kind of error, is it possible to set up a temporary Windows exception during the JFR dumping, so we can catch the error? Also, why don't we have a mini dump file? The CreateCoredumpOnCrash is not disabled, so we should have one. ====================== TargetApp (stdout): [2.498s][info][jfr,startup] Use jcmd 47116 JFR.dump name=1 filename=FILEPATH to copy recording data to file. [.......] TargetApp (stdout): - jvmti_aod.cpp, 283: Redefining TargetApp (stdout): - aod.cpp, 253: Agent NativeAgent-0 finished (success: 1) TargetApp (stdout): Agent 'NativeAgent-0' finished execution (finishedSuccessfully: true) TargetApp (stdout): InterruptedException.getMessage(): 'attach002a: redefined version' TargetApp (stdout): Waiting for agents finishing TargetApp (stdout): All agents finished execution TargetApp (stdout): Signal received: 'finish' TargetApp (stdout): Test passed ----------System.err:(14/982)---------- nsk.share.Failure: Target application finished with non-zero code -1073741819 at nsk.share.aod.AODTestRunner.runTest(AODTestRunner.java:153) at nsk.share.aod.AODTestRunner.main(AODTestRunner.java:184) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127) at java.base/java.lang.Thread.run(Thread.java:833)
08-09-2021

The error code is an access violation but there is no hs_err log it seems. I would have to suspect something is crashing very late in VM termination process.
23-08-2021

This failure mode reminds me of: JDK-8251849 jdk/jfr/startupargs/TestDumpOnExit.java failed with "exitValue = -1073741819"
11-02-2021