JDK-8220786 : Create new switch to redirect error reporting output to stdout or stderr
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-03-18
  • Updated: 2021-08-06
  • Resolved: 2019-03-28
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.7Fixed 13 b15Fixed openjdk8u312Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Description
In certain container environments the local file system is ephemeral - its content does not survive the death of the container. In those environments post-mortem analyzing crashes can be challenging. However, stdout and stderr of the VM process are usually catched in some sort of logging system.

A new switch is proposed, "-XX:ErrorFileRedirect", with two possible values, "stdout" or "stderr". If specified, it would print the error report to stdout or stderr instead of creating a hs-err file.

If specified in conjunction with -XX:ErrorFile, a warning should be printed about incompatible switches, and -XX:ErrorFile should be ignored.
Comments
Fix Request (8u). After-the-fact request. Also added jdk8u-fix-request and jdk8u-fix-yes tags. Review threads: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2021-June/013946.html https://mail.openjdk.java.net/pipermail/jdk8u-dev/2021-July/014078.html
06-08-2021

Fix Request: The enhancement is valuable in cloud scenarios without any local file systems. It provides the ability to stream crash reports to stdout/err instead of into the local file system. The risk is minimal. New code only executes when VM has a fatal error, and only when one of the new switches (ErrorFileToStdout/ErrorFileToStderr) are specified. The associated backport CSR https://bugs.openjdk.java.net/browse/JDK-8238532 has been approved. SAP nightlies showed no issues. Manual tests okay. RFR discussion: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-February/002453.html reviewed and approved.
11-02-2020