yabai icon indicating copy to clipboard operation
yabai copied to clipboard

Yabai crashes LibreOffice

Open kiryph opened this issue 1 year ago • 8 comments

Versions

  • yabai 4.0.1 (installed via homebrew)
  • LibreOffice 7.3.5 (installed via dmg from libreoffice.org)
  • macOS 11.6.8

Can someone else confirm issues between yabai and LibreOffice?

It happens mostly when I open several documents but not exclusively.

I can resolve the problem when I configure yabai to not manage LibreOffice with

yabai -m rule --add app="^LibreOffice$" manage=off layer=above

crash.log (2.6MB)

kiryph avatar Jul 30 '22 14:07 kiryph

I've been having the same problem, with Yabai on one machine and also the same thing happens on my Macbook Pro running Amethyst. macos version is 11.6.8, however it was happening in macos 10.x as well. Libreoffice freezes and I have to force quit the app and restore the document. If I turn off Amethyst, or use your code within .yabairc, Libroffice runs fine.

Italia38 avatar Aug 17 '22 15:08 Italia38

The new Yabai version 4.0.2 seems to have reduced the problem. For example, when I do not invoke too many window movement commands quickly, the LibreOffice window remains responsive.

kiryph avatar Aug 24 '22 18:08 kiryph

4.0.2 seems to have fixed the problem when using only 1 LibreOffice window, but I can still consistently reproduce the issue with a 2nd window.

One of the simpler procedures to reproduce:

  1. Open LibreOffice application (which opens the startup screen)
  2. Create a new Writer Document via the startup screen (which replaces the contents of the 1st window with Writer)
  3. Create a new Calc Spreadsheet via File -> New -> Spreadsheet (which opens a 2nd window)
  4. Close the Calc Spreadsheet

Observed behavior: LibreOffice hangs indefinitely, LibreOffice+yabai show the same CPU usage via Activity Monitor

Sample of yabai.txt

I've removed the manage=off rule for LibreOffice since 4.0.2. I'm glad for this, as setting that rule broke drop-down menus in LibreOffice (#995) in 4.0.1 and earlier—I'd usually have to quit yabai whenever working in Libre.

chairfield avatar Aug 27 '22 18:08 chairfield

Unfortunately this appears to be an issue that must be fixed in LibreOffice. Your best bet is to make a report there; feel free to link this issue in the report as well.

The latest release of yabai had some changes to reduce the amount of calls that is made to the AX API which seems to have helped, but this is the official API that we have to manage external applications, and so they need to resolve whatever issue they have that causes LibreOffice to crash (when they receive too many requests?).

koekeishiya avatar Aug 27 '22 19:08 koekeishiya

Thank you for the guidance and quick response. It makes sense. In starting down this path, I discovered that LibreOffice 7.4.0 is less susceptible to the freeze (I found little to no difference between 7.2.2, which I was running, and 7.3.5, which is the more stable version currently recommended for download).

My earlier procedure no longer reproduces the issue. However, it still does if I replace step 3 with creating a new Presentation.

Interestingly, once I reproduce the freeze and force quit LibreOffice, any subsequent Libre processes I start are much more likely to freeze. If I then restart yabai, the freeze returns to being harder to trigger.

Does force quitting Libre leave state in yabai that might alter its behavior w.r.t. the AX API?

chairfield avatar Aug 27 '22 21:08 chairfield

Does force quitting Libre leave state in yabai that might alter its behavior w.r.t. the AX API?

No state should be left behind in yabai when an application terminates, regardless of how it terminated.

koekeishiya avatar Aug 27 '22 22:08 koekeishiya

I've made further changes on master that should reduce usage of the AX API as much as possible. (Up until now there have been redundant calls to the AX API when certain modifications have been made to the window tree). Not sure if it will help for this particular case, but figured I'd mention it.

koekeishiya avatar Aug 28 '22 04:08 koekeishiya

Your changes helped. Now, once a freeze occurs, I'm no longer forced to restart yabai after force-quitting Libre. Subsequent Libre freezes are still more likely, but no longer guaranteed to happen immediately.

Steps to trigger the initial freeze have changed in a mixed way. Compared to 4.0.2, for instance, HEAD is less likely to freeze Libre when opening a second Presentation window, yet more likely with a second Spreadsheet window. I'm unconcerned with these subtler changes in behavior.

I appreciate you doing what you can to work around Libre's behavior, and consider this an improvement overall.

chairfield avatar Aug 28 '22 15:08 chairfield

Did anybody create an upstream bugreport at libreoffice?

hpfmn avatar Oct 11 '22 14:10 hpfmn

I don't think I understand this well enough to file a clear and reproable bug on the Libre side, so I haven't.

chairfield avatar Oct 15 '22 19:10 chairfield

This appears fixed. I just upgraded the following:

  • LibreOffice: 7.4.0 -> 7.4.5
  • yabai: v5.0.1 -> v5.0.2

If anyone's still experiencing this issue, I'd recommend first upgrading LibreOffice to its latest stable release.

I've remained on macOS Monterey since my first comment last August, and am currently on12.6.3.

Windows and modals galore, without a hitch: LibreOffice-7 4 5

chairfield avatar Feb 11 '23 17:02 chairfield

Closing this as per the comment above.

koekeishiya avatar Feb 23 '24 20:02 koekeishiya