Date: Mon, 30 May 2022 20:45:32 +0000 From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 264356] java/openjdk17: Exception with multi-screen setup Message-ID: <bug-264356-7788@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264356 Bug ID: 264356 Summary: java/openjdk17: Exception with multi-screen setup Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: java@FreeBSD.org Reporter: scf@FreeBSD.org Flags: maintainer-feedback?(java@FreeBSD.org) Assignee: java@FreeBSD.org Attachment #234335 text/plain mime type: Created attachment 234335 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D234335&action= =3Dedit Fix for screen count Starting in OpenJDK 17 (tested on FreeBSD), a call to java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment() will cause a program to throw java.lang.ExceptionInInitializerError if run on a screen that is not the first screen, i.e., :3.0. I am unsure how good the attached fix is, but it does prevent the crash. Basically, the variable screens is null when run on another screen such as :3.1. As the only thing needed is the number of screens, I switched it to use the already defined numScreens. It is easy to duplicate using xephyr: Xephyr :3 -screen 800x600 -screen 800x600 Running the attached java program on screen :3.0 will work. Running it on screen :3.1 throws an exception: Exception in thread "main" java.lang.ExceptionInInitializerError at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Graph= icsEnvironment.java:106) at GraphEnv.main(GraphEnv.java:18) Caused by: java.lang.NullPointerException: Cannot read the array length bec= ause "this.screens" is null at java.desktop/sun.awt.X11GraphicsEnvironment.initDevices(X11GraphicsEnvironm= ent.java:235) at java.desktop/sun.awt.X11GraphicsEnvironment.rebuildDevices(X11GraphicsEnvir= onment.java:216) at java.desktop/sun.awt.X11GraphicsEnvironment.<init>(X11GraphicsEnvironment.j= ava:201) at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.jav= a:36) at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironm= ent.java:93) at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironm= ent.java:84) at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Graph= icsEnvironment.java:106) at GraphEnv.main(GraphEnv.java:18) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Meth= od) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethod= AccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Delegati= ngMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at jdk.compiler/com.sun.tools.javac.launcher.Main.execute(Main.java:419) at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:192) at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:13= 2) --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-264356-7788>