review request (S): 7199082 write warning messages to stderr

David Holmes david.holmes at oracle.com
Tue Sep 18 22:51:17 PDT 2012


On 19/09/2012 3:37 PM, Staffan Larsen wrote:
> Looks good. All kinds of logging/warning/error messages from the JVM should go to stderr.

In which case the correct fix would be to change tty from defaulting to 
stdout, to default to stderr.

When you have a program that runs a program and they share stdout and 
stderr then you can't always win: no matter where the VM writes to it 
can interfere with what the app writes. So all hotspot output is 
nominally sent to 1 place - the tty - and you can then configure the tty 
to either connect to stdout (the default) or stderr. (And additionally 
some logging/tracing subsystems allow you to use files to get the VM 
output out of the picture completely.).

Hence I really don't like that we are special casing warnings. :(

I think this change will have repercussions, no matter what we try to do 
to fiddle the output streams, and the issue is whether those 
repercussions will become known before or after we ship JDK8.

My opinion (as I've expressed elsewhere) is that we leave warnings/tty 
alone and instead we stop issuing the PermGen warnings for JDK8. We can 
then enable the warnings for JDK9 (and send them to wherever tty sends 
them) and in JDK10 simply abort if the options are given.

David

> /Staffan
>
> On 18 sep 2012, at 20:47, John Coomes<John.Coomes at oracle.com>  wrote:
>
>> Small change to warning() to write to error_stream() instead of tty.
>>
>> http://cr.openjdk.java.net/~jcoomes/7199082-warn-stderr/
>>
>> Bug link:
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7199082
>>
>> -John
>


More information about the hotspot-runtime-dev mailing list