JDK-8215004 : DisplayVMOutputToStderr is not evaluated for error reporting
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 12
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2018-12-07
  • Updated: 2020-02-11
  • Resolved: 2020-01-28
Related Reports
Relates :  
Description
In case a fatal error happens, a short description is written to stdout (#-prefixed).

DisplayVMOutputToStderr should allow to redirect this section to stder. But this does not work, since the switch is in this case evaluated too early, during dynamic initialization of the static VMError::out member, way before arguments are parsed:

fdStream VMError::out(defaultStream::output_fd());
with defaultStream::output_fd being:
return DisplayVMOutputToStderr ? _error_stream : _output_stream;

--

The result is that whatever the setting for DisplayVMOutputToStderr, the "error-hash-section" gets always printed out to stdout.

Compatibility concerns:

At this time, I am not even sure we should change this behavior. Many parsers may now rely on the error report going to stdout and expect it there. It seems never have to bothered anyone.

So maybe the right fix would be to just remove DisplayVMOutputToStderr from VMError output stream initialization.


Comments
Runtime Triage: This is not on our current list of priorities. We will consider this feature if we receive additional customer requirements.
28-01-2020