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

Coleen Phillimore coleen.phillimore at oracle.com
Wed Sep 19 07:47:08 PDT 2012


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