From nobody Mon May 30 20:45:32 2022 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 45FBC1B45FC0 for ; Mon, 30 May 2022 20:45:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LBnVP0HzVz3qbb for ; Mon, 30 May 2022 20:45:33 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEBA51E50F for ; Mon, 30 May 2022 20:45:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 24UKjWC5074460 for ; Mon, 30 May 2022 20:45:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 24UKjWdk074459 for ports-bugs@FreeBSD.org; Mon, 30 May 2022 20:45:32 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 264356] java/openjdk17: Exception with multi-screen setup Date: Mon, 30 May 2022 20:45:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: scf@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: java@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name attachments.mimetype attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653943533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e+9YqToFLDKOkDoWABSloVFivvT0j/+15f/8VZuW4Cg=; b=BVaPugLhp03i2bJROB5bCM7UbOAEt2GellWJMMkKn18t5+l+lDeZo7Rmqg3Wa0SZO8CqPC YcGYXkwUNK4bOsb78fxYgjbhvs6HF2JD+ExfVEc+PBx2cZDX+QAm2brhbYBNcViYfls04p 1j5bE1zGmV+KNy5Ep8XerwUttFJ/iKG6LSu7GJJpK3CizVwUcYkYeYSRhtCDru2OYpNiiC CgthlcBLL3/b62rbZmJWjAH7cz+eF40UPJwq1a77+eyLvrKphBPDOy7nEzIYIEOiKRdEws IUFDn2qrLWIfYhWkFOkMtmCNfVkZIJMk9YnZG7qmqs3fzyALRZeh78fTS75TTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653943533; a=rsa-sha256; cv=none; b=E/upla+KUt2ic5MHdeAppyercnoh85n2qqN1Kp+/h+I4DvflYeL9tYU1iIiBUvHvcU5Zye wOcHuJP63wil8AuodKkXt6nXKE0uW86HzwYwJ1zCeHTs42WeOHhTaird3YjlS2APvNhSkW 5cmvezGnZU2NbMBCVj2sT1DA1Vkn3KycL6byqYcmckTCtKkLF247u8AtDf3epWkR4HsAfy q76KRyTCgl8A7unuzFlKlp2vACZUlhgvpM84bI2VXLpRkuT0NOjkcO/mWoESZKPv2xN5Ua 0RHXedh8+ydhlrfJ7Nzx9OZCwhdnYE0SYPaGcP7V7znoGWjNOebFqxHmoMfLMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N 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.(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.(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.=