<AWT Dev>  Review Request: 8208702 javax/swing/reliability/HangDuringStaticInitialization.java may hang on macos
Sergey.Bylokhov at oracle.com
Tue Oct 30 18:17:53 UTC 2018
It is not possible to avoid duplication from the implementation point of view, because these two libraries should not depend from each other. It is possible to deduplicate it in the source code, for example by moving this method to some separate header in the java.base and use it from java.desktop. But actually we have a separate goal to remove the client code from launcher. So at some point the code, where isInAquaSession() is used in the launcher, will be removed.
On 29/10/2018 23:02, Denis Fokin wrote:
> Is there a way to avoid the code duplication?
> Thank you,
> On Tue, 30 Oct 2018 at 03:57, Sergey Bylokhov <Sergey.Bylokhov at oracle.com <mailto:Sergey.Bylokhov at oracle.com>> wrote:
> Any volunteers to review? =)
> On 06/08/2018 19:06, Sergey Bylokhov wrote:
> > Hello.
> > Please review the fix for jdk12.
> > Bug: https://bugs.openjdk.java.net/browse/JDK-8208702
> > Webrev: http://cr.openjdk.java.net/~serb/8208702/webrev.01
> > The new test which was added as part of JDK-8189604 may hang on macOS if it is run via ssh, and the user used in ssh and the current user in GUI login session are different. But it works if the users are the same.
> > =====================
> > This is part of the spec describe why it works in some cases and does not work in another:
> > "The reasons for this non-obvious behavior are lost in the depths of history. However, the fact that this works at all is pretty much irrelevant because there are important caveats that prevent it from being truly useful."
> > https://developer.apple.com/library/archive/technotes/tn2083/_index.html#//apple_ref/doc/uid/DTS10003794-CH1-SUBSECTION14
> > Also please take a look to the "Listing 6" in the link above, which describe similar situation.
> > =====================
> > Note that by default in such environment the java will use the headless toolkit which works fine. But the test forces to use the "headful toolkit" using "-Djava.awt.headless=false", which causes a hang in our Appkit initialization.
> > On unix in the same circumstances we will throw the AWTError. I have implemented the same on macOS. If "Security Context" reports that "sessionHasGraphicAccess" is false and the user requests "headful toolkit" we will throw AWTError.
> >  https://bugs.openjdk.java.net/browse/JDK-8189604
> >  http://hg.openjdk.java.net/jdk/client/file/f91e995f6d5c/src/java.base/unix/native/libjava/java_props_md.c#l405
> >  http://hg.openjdk.java.net/jdk/client/file/f91e995f6d5c/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c#l758
> >  https://developer.apple.com/library/archive/technotes/tn2083/_index.html#//apple_ref/doc/uid/DTS10003794-CH1-SUBSECTION19
> Best regards, Sergey.
Best regards, Sergey.
More information about the awt-dev