RFR: 8271949: dumppath in -XX:FlightRecorderOptions does not affect [v3]
Markus Grönlund
mgronlun at openjdk.java.net
Fri Sep 3 15:26:29 UTC 2021
On Tue, 31 Aug 2021 02:27:52 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:
>> We set `dumppath` in `-XX:FlightRecorderOptions` or `JFR.configure dumppath` jcmd when we want to set emergency dump path. However they do not afffect.
>>
>> ### -XX:FlightRecorderOptions
>>
>>
>> $ java -XX:FlightRecorderOptions=dumppath=`pwd` -XX:StartFlightRecording -Xlog:exceptions=info --version
>> [0.032s][info][exceptions] Exception <a 'java/lang/IllegalArgumentException'{0x00000007470163b8}: Unknown argument 'dumppath' in diagnostic command.> (0x00000007470163b8)
>> thrown [open/src/hotspot/share/services/diagnosticFramework.cpp, line 215]
>> for thread 0x00007f4f700236a0
>> [0.033s][error][arguments ] Unknown argument 'dumppath' in diagnostic command.
>> Error occurred during initialization of VM
>> Failure when starting JFR on_create_vm_2
>>
>>
>> ### jcmd
>>
>> `jcmd` shows the configuration change was succeeded, but it would not affect.
>>
>>
>> $ jcmd 1046 JFR.configure dumppath=/tmp
>> 1046:
>> Dump path: /tmp
>
> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:
>
> Update testcase
Hi Yasumasa,
I noted the following when stepping through the patch:
1. Mismatch in default behaviour for paths between option "repository" and "dumppath" for relative paths:
-XX:FlightRecorderOptions=repository=apa,dumppath=ko
Repository path: $PWD/apa
Emergency dump path: ko
2. Modified default output in hs_err<pid>.log file:
From:
<pre>
# CreateCoredumpOnCrash turned off, no core file dumped"
#
# JFR recording file will be written. Location: D:\utilities\jtreg\runtime_artifacts\work\jdk\jfr\jvm\TestDumpOnCrash\hs_err_pid23516.jfr
#
# An error report file with more information is saved as:
# D:\utilities\jtreg\runtime_artifacts\work\jdk\jfr\jvm\TestDumpOnCrash\hs_err_pid23516.log
#
</pre>
To:
<pre>
# CreateCoredumpOnCrash turned off, no core file dumped
#
# JFR recording file will be written. Location: .\hs_err_pid23516.jfr <<--- not printing the full path as before
#
# An error report file with more information is saved as:
# D:\utilities\jtreg\runtime_artifacts\work\jdk\jfr\jvm\TestDumpOnCrash\hs_err_pid23516.log
#
</pre>
3. "Path to dump" description is vague. It is not clear that it must be directory, let alone that the directory must exist, and that you need write-access to it:
-XX:FlightRecorderOptions=maxchunksize=1m,repository=apa,dumppath=C:\temp\mydump.jfr ?
4. Lack of troubleshooting information:
Any problematic path, for example specifying mounts that do not exist, wrong spelling, specifying a file path instead of a directory path, lack of security etc will get this:
<pre>
#
# CreateCoredumpOnCrash turned off, no core file dumped
#
# The JFR repository may contain useful JFR files. Location: C:\Users\mgronlun\AppData\Local\Temp\2021_09_03_16_36_14_7524
#
# An error report file with more information is saved as:
# D:\utilities\jtreg\runtime_artifacts\work\jdk\jfr\jvm\TestDumpOnCrash\hs_err_pid7524.log
</pre>
Why was the not my stated dumppath=<path> taken into account and used in creating a emergency dump file?
Thanks
Markus
-------------
PR: https://git.openjdk.java.net/jdk/pull/5019
More information about the hotspot-jfr-dev
mailing list