JDK-8217362 : Emergency dump does not work when disk=false is set
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 11,12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-01-18
  • Updated: 2021-05-04
  • Resolved: 2019-03-25
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 11 JDK 13 Other
11.0.12-oracleFixed 13 b14Fixed openjdk8u282Fixed
Related Reports
Relates :  
Description
Emergency dump does not work when disk=false is set to -XX:StartFlightRecodging.
I investigated this with strace on Linux x64. HotSpot attempted to open emergency flight record file, but open syscall returned ENOENT as below:

-------------
[pid  4929] openat(AT_FDCWD, "/home/ysuenaga/github/garakuta/NativeSEGV/hs_err_pid4928.jfr", O_RDWR|O_CLOEXEC) = -1 ENOENT (No such file or directory)
-------------

We need to pass `O_CREAT | O_WRONLY` to `os::open()`.
(disk=true (default) works fine)


How to reproduce:

1. Build testcase
  https://github.com/YaSuenag/garakuta/tree/master/NativeSEGV
    $ export JAVA_HOME=<path>
    $ make

2. Run testcase
    $ $JAVA_HOME/bin/java -XX:StartFlightRecording=disk=false -Djava.library.path=. NativeSEGV
Comments
8u fix request. RFR approved https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-October/012872.html
28-10-2020

8u review request: the patch does not apply cleanly. RFR https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-October/012807.html Tested with tier1 and jdk.jfr tests on Linux and Windows.
21-10-2020

Comment: Fix Request 11u exists same problem, this patch does not apply cleanly to 11u and requires adjustments. 11u RFR: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-September/001932.html
26-09-2019

Review request: https://mail.openjdk.java.net/pipermail/hotspot-jfr-dev/2019-January/000374.html
12-02-2019