JDK-8239894 : Xserver crashes when the wrong high refresh rate is used
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 11,13,14,15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2020-02-25
  • Updated: 2021-01-28
  • Resolved: 2021-01-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b07Fixed
Related Reports
Relates :  
Description
We use two different approaches to listing the display modes on the system:
 - For single-screen configuration use version 1.1 protocol XRRGetScreenInfo/XRRConfigRates/XRRConfigSizes 
 - For multi-screen configuration use version 1.2 protocol: XRRGetScreenResources/XRRGetOutputInfo/XRRModeInfo

Unfortunately, the current code does not work for some specific double scan modes, it doubles the real refresh rate. If this refresh rate will be passed to the Xserver later it could hang/crash.

The same bug existed in xrandr utility before version 1.4:
https://bugs.freedesktop.org/show_bug.cgi?id=37043
https://gitlab.freedesktop.org/xorg/app/xrandr/commit/7fd4f18b649f22fad4dbf9fc64b69b3e7f172207

Looks like we should drop the code for single-screen configuration, and always use the multi-screen code patched by the fix above.
Comments
Changeset: a7c2ebc7 Author: Sergey Bylokhov <serb@openjdk.org> Date: 2021-01-22 00:21:36 +0000 URL: https://git.openjdk.java.net/jdk/commit/a7c2ebc7
22-01-2021

Bug for scalefactor: JDK-8260270 Bug for display mode: JDK-8260271
22-01-2021

Note: the size smaller than 320x200 does not work even if reported by the HW: https://bugzilla.redhat.com/show_bug.cgi?id=1666173
25-02-2020