JDK-8340378 : [XWayland] FXCanvas apps and tests crash on Ubuntu 24.04
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: jfx24,jfx25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: generic
  • Submitted: 2024-09-18
  • Updated: 2025-09-24
  • Resolved: 2025-09-15
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.
Other
jfx26 b08Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Description
We have recently open-sourced new test app HelloFXCanvas under JDK-8211247 and this toy crashes when run on Ubuntu 24.04 with the Wayland display server. Follow apps/toys/HelloFXCanvas/README.txt to launch the test app.
Comments
Changeset: 17e37c21 Branch: master Author: Jayathirth D V <jdv@openjdk.org> Date: 2025-09-15 03:27:36 +0000 URL: https://git.openjdk.org/jfx/commit/17e37c21d7afdf435138e2068ea03c7ecc1bbba1
15-09-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx/pull/1898 Date: 2025-09-12 08:32:38 +0000
12-09-2025

GDK_BACKEND is an environment variable and looks like using System.getenv() you can just get details of environment variable and not set things. I checked other things like using Reflection to set environment variable, but i think that is not current solution here. I also checked about updating Netbeans properties and details in project.properties file like adding line : run.args.extra=-J-DGDK_BACKEND=x11 . But setting things like this is treated as system property and not environment variable. So we need to update README.txt to mention that we need to explicitly call "export GDK_BACKEND=x11" for running this test.
12-09-2025

If i use "export GDK_BACKEND=x11" on my Ubuntu 24.04 machine, HelloFXCanvas runs fine. Didn't find appropriate way to restrict setting this variable only for Linux platforms(Tried updating project.properties file). We already have platform specific information in HelloFXCanvas/README.txt, we can add similar info for Linux to fix this issue.
10-09-2025

This issue was first noted when fixing JDK-8210411 to allow JavaFX to run on Linux with the XWayland server. In that issue, the following comment was made: "While using SWT-FX interop, same issue is being found. To run SWT-FX interop, set the GDK_BACKEND=x11 in your environment (Terminal) and it should work fine." The fix for this crash will therefore be to add a call to `putenv("GDK_BACKEND=x11")` in each SWT / JavaFX interop program that uses FXCanvas when running on Linux. This includes: * HelloFXCanvas * swt unit tests See the comments in the following PR for additional info: https://github.com/openjdk/jfx/pull/1783
05-05-2025

It's crashing in libX11.so called by libglassgtk3.so, so it might be some interaction between swt and glass that is causing this bug.
11-10-2024

Here are the details of the crash. $ java @build/run.args --add-modules javafx.swt --enable-native-access=ALL-UNNAMED -cp apps/toys/HelloFXCanvas/dist/HelloFXCanvas.jar:build/libs/swt-debug.jar hellofxcanvas.HelloFXCanvas # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x000078bc82fcbe96, pid=12025, tid=12026 # # JRE version: Java(TM) SE Runtime Environment (21.0.2+13) (build 21.0.2+13-LTS-58) # Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0.2+13-LTS-58, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # C [libX11.so.6+0x2be96] # # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/kcr/javafx/jfx-kcr/jfx/rt/core.12025) # # An error report file with more information is saved as: # /home/kcr/javafx/jfx-kcr/jfx/rt/hs_err_pid12025.log # # If you would like to submit a bug report, please visit: # https://bugreport.java.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. #
11-10-2024