RFR: JDK-8292351: tty should always live
Thomas Stuefe
stuefe at openjdk.org
Mon Aug 15 14:22:35 UTC 2022
On Mon, 15 Aug 2022 13:23:58 GMT, David Holmes <dholmes at openjdk.org> wrote:
> So effectively this just introduces an alternate tty device for pre-init and post-shutdown. But if the tty is not stdout then you are now forcing use of stdout in an environment where someone may have taken steps to ensure stdout is not in fact used.
I don't force using stdout. I prevent the VM from crashing. Before my patch, the VM would have crashed. Now it prints the message it wanted to print, to stdout, which is in 99 % of all cases what users expect anyway since it's the default behavior.
> Is that real concern?
Yes. So much that in our downstream VMs I have stopped using tty and instead use fdStream(1) or (2) as much as possible, unless I am absolutely sure that tty is valid whenever my code runs. But this is a style I cannot use in OpenJDK since the rule is "use tty".
> I don't know. We jump through a number of hoops in terms of controlling VM output and it seems somewhat excessive to me, but I have to assume there were valid reasons for the level of complexity that it exists.
I don't particularly like defaultStream, especially its XML mode, and would be happy if it were simplified.
>
> Need to think more about this ...
-------------
PR: https://git.openjdk.org/jdk/pull/9874
More information about the hotspot-dev
mailing list