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

John Coomes John.Coomes at oracle.com
Wed Sep 19 14:35:46 PDT 2012


David Holmes (david.holmes at oracle.com) wrote:
> 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.

It's a big compatilibity change.  PrintGC, PrintGCDetails,
LogCompilation, etc., have been on stdout for like 10 years.  I
really, really think that's best done when there's a more flexible
framework in place that allows sending the output to a file, stdout,
stderr, the moon--wherever users want.

> 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. ...

It's ok to disable the warnings for the Perm options, but that's a
separate choice.  Doing only that will fix the problem only until the
next warning shows up.

I still think all JVM warnings should go to stderr (more precisely, to
error_stream(), which defaults to stderr).  Even if other JVM output
goes to stdout.

-John

> ...                                                              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.


> > 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