JDK-8267572 : java.awt.Desktop.open hangs on Linux when called from FX application thread
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8,15,16,17
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • Submitted: 2021-05-22
  • Updated: 2021-06-05
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
tbdUnresolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
This is a follow-on bug that I discovered while testing the fix for JDK-8210199.

To reproduce, run the attached test program on Linux. It will hang with a possible deadlock. The FX application thread, which calls Desktop.open, is stuck in "sun.awt.X11.XDesktopPeer.gnome_url_show".

The complete thread stack dump is attached.

It's quite possible that the FX glass GTK code is doing something to trigger this.

This runs fine on macOS and Windows.

Workaround: wrap the call to Desktop.open in SwingUtilities.invokeLater().
Comments
I recall that the same issue(JDK-8123117) was filed several years ago, it was closed as not an issue by me. Let this be open to revisit it later, but the main idea is still the same: don't do that on FX Application thread.
04-06-2021