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

John Coomes John.Coomes at oracle.com
Thu Sep 20 17:19:38 PDT 2012


Srinivas Ramakrishna (ysr1729 at gmail.com) wrote:
> While I haven't followed the discussion very closely, I believe that separating
> warnings off into the error stream is in fact the right thing to do,
> because error streams are more likely to be looked at by users. As regards
> silently ignoring the perm gen flag, ignoring is fine, but emitting a
> warning while ignoring has, really, been how we've managed options changes in
> the past, so there is precedent to this warning. It's really these
> warnings that allow users to adjust their options/flags and become aware of
> many of these kinds of changes.
> 
> So, personally, I think issuing a warning is the right thing to do, and the
> change of sending warnings to the error stream also seems to me
> to be a good thing, but then I may have missed some of the subtler arguments
> against that move being discussed here (and perhaps I'll grok
> them on a slower, more focused re-reading of them :-)

I agree w/you :-), and I'm pushing this change.  I did want to note
that I spoke with Coleen and clarified that she did not object to the
change, but was looking forward to having the whole JVM output issue
revisited.

-John

> On Wed, Sep 19, 2012 at 7:47 AM, Coleen Phillimore <
> coleen.phillimore at oracle.com> wrote:
> 
>     On 9/19/2012 3:11 AM, Staffan Larsen wrote:
> 
>         Thanks for clarifying a bit on how tty and VM output works. I've
>         re-read the changes and the source code as well as discussed this with
>         Stefan and Bengt.
> 
>         There are two (or more) problems here:
> 
>         1) VM output should default to stderr. But this should be discussed
>         separately and not as a quick fix to this specific problem. A good
>         timeframe for this could be JDK 8 since it's a major release. I agree
>         with David that we shouldn't special case some of the VM output, it
>         should all go to the same place (unless explicitly changed by the
>         user).
> 
> 
>     Also, there are a lot of bugs and history about this, which always result
>     in us backing away slowly.   If we want to make a change here, search the
>     bug database for the discussions.   Some might be relevant now, some not.  
>     I think this is how we got the -XX:+DisplayOutputToStderr flag as a partial
>     solution.
> 
>     Coleen
> 
> 
> 
> 
>         2) The JDK build fails with the warnings issued for the deprecated
>         permgen flags. Perhaps this is better fixed in the JDK build by either
>         removing the usage of the permgen flags or adding
>         -XX:+DisplayVMOutputToStderr. How doable is that?
> 
>         It seems to me that we already have a precedent for writing warnings
>         about deprecated flags (the whole obsolete_jvm_flags list) and that the
>         permgen flags are a perfect fit for this list. I think it is reasonable
>         that we should issue warnings in jdk8 and error/abort in jdk9.
> 
>         Thanks,
>         /Staffan
> 
> 
>         On 19 sep 2012, at 07:51, 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.
> 
>             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