JDK-8262292 : JavaFX deadlocks if another app is using macOS Accessibility API in the background
  • Type: Bug
  • Component: javafx
  • Sub-Component: accessibility
  • Affected Version: jfx15
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2021-02-15
  • Updated: 2023-08-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.
Other
tbdUnresolved
Related Reports
Duplicate :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
macOS 10.15.7
JavaFX 15.0.1
openjdk15/jdk-15.0.1+9

A DESCRIPTION OF THE PROBLEM :
This issue seems to be the same as described in https://bugs.openjdk.java.net/browse/JDK-8214209

You can find more context, steps to reproduce, and analysis on this ticket as well: https://github.com/lwouis/alt-tab-macos/issues/822#issuecomment-778902109

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
* Run the AltTab app (download .app here: https://alt-tab-macos.netlify.app/)
* Run the MediathekView app: https://github.com/mediathekview/MediathekView.git (download the pre-built mac app, or git clone + run it)
* In MediathekView, click the "Merkliste verwalten" button (see screenshot here: https://github.com/lwouis/alt-tab-macos/issues/822#issuecomment-778902109)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A window opens and the app runs normally
ACTUAL -
The app freezes indefinitely (deadlock)

---------- BEGIN SOURCE ----------
You can run/debug the source code of MediathekView here: https://github.com/mediathekview/MediathekView I did it and found that it deadlocks in JavaFX code. More analysis from me: https://github.com/lwouis/alt-tab-macos/issues/822#issuecomment-778916280
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
The app works correctly if AltTab is not running. I'm the author of AltTab, and I've seen similar issues in Java apps. I've seen it in Jetbrains product for instance, and they are not using JavaFX I imagine. That could imply that the issue is lower in the stack (e.g. in the AWT layers).

In AltTab, I can prevent the issue triggering in MediathekView by removing 1 line of code, so it seems to be the issue. That line is a call to `AXObserverAddNotification` to get notified of the Accessibility event called `kAXFocusedUIElementChangedNotification`. Observing that event creates an issue in Java apps that results in a deadlock apparently.

FREQUENCY : always



Comments
Additional Information from submitter: =========================== I have the easy-to-reproduce scenario I shared with you. It's about downloading 2 apps and running them and observing the issue. Reproduces every time, and you can debug the Java one since it's open-source to see exactly where it freezes. That's all I can provide to you. I'm not the author of the Java app. You can contact them on their github and ask for more details, including a smaller reproduction case maybe. I think you're asking for some kind of minimal project that only demonstrates the issue in isolation. I don't have such a thing handy for you, unfortunately. As I mentioned though, the repro steps I shared are easy to execute, the issue is easy to witness, and the open-source app is easy to run to debug and see where the issue is happening. There are stack traces screenshots on the ticket as well to give your engineers leads.
17-03-2021

Mail to submitter: ============= Could you please share standalone test case/reproducible steps to analyze this issue better.
09-03-2021