Bug 164432 - LibreOffice may have no response when launched for the first time on macOS
Summary: LibreOffice may have no response when launched for the first time on macOS
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
24.8.4.2 release
Hardware: All macOS (All)
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-23 05:19 UTC by majd
Modified: 2025-02-21 22:05 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Spindump whilst waiting for LibreOffice to display StartCenter (4.22 MB, text/plain)
2025-02-13 10:11 UTC, Alex Thurgood
Details
Spindump after StartCenter is displayed (3.25 MB, text/plain)
2025-02-13 10:13 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description majd 2024-12-23 05:19:41 UTC
Description:
LibreOffice may have no response when launched for the first time on macOS Intel.

Steps to Reproduce:
1.install libreoffice for the first time on macos
2.open libreoffice
3.no response

Actual Results:
no response

Expected Results:
open libreoffice


Reproducible: Sometimes


User Profile Reset: No

Additional Info:
happens only for the first time when open libreoffice
Comment 1 Alex Thurgood 2025-01-07 14:46:15 UTC
I noticed this also yesterday with 

Version: 25.8.0.0.alpha0+ (AARCH64) / LibreOffice Community
Build ID: 022e95d39d9ae29496be0f81740eefaf515f578a
CPU threads: 8; OS: macOS 15.2; UI render: Skia/Metal; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: threaded

so it isn't just limited to Intel. I had to click on the LO dock icon to cause LO to bring up the main application window, as the launch process appeared to have either failed, or simply stalled.

I'd been puzzled by this in previous daily versions as well, so the problem isn't new, but I wouldn't be able to say when it started, as I originally put it down to a delay in LO initialising itself on startup.
Comment 2 Alex Thurgood 2025-01-07 14:47:26 UTC
As OP has indicated, this only seems to happen the very first time that a freshly installed version of LO is started.
Comment 3 Alex Thurgood 2025-02-08 09:51:08 UTC
The rot has spread to aarch64 as well.
Changing title to reflect that.

After installing 25.2.0.3 for aarch macOS, I waited more than 2 minutes for the StartCenter to appear, but no joy, so I forced killed the soffice process, and restarted. After restart, the appearance of the StartCenter was almost instantaneous.

This is turning into a most annoying bug.
Comment 4 Patrick (volunteer) 2025-02-08 14:19:38 UTC
I cannot reproduce this bug. First a deleted all my LibreOffice files with the following command:

rm -Rf ~/Library/Application\ Support/LibreOffice

Then when I launch LibreOffice, the Start Center appears within about 5 seconds:

Version: 25.2.0.3 (AARCH64) / LibreOffice Community
Build ID: e1cf4a87eb02d755bce1a01209907ea5ddc8f069
CPU threads: 8; OS: macOS 15.3; UI render: Skia/Metal; VCL: osx
Locale: en-CA (en_CA.UTF-8); UI: en-US
Calc: threaded
Comment 5 Alex Thurgood 2025-02-08 15:23:13 UTC
(In reply to Patrick (volunteer) from comment #4)
> I cannot reproduce this bug. First a deleted all my LibreOffice files with
> the following command:
> 
> rm -Rf ~/Library/Application\ Support/LibreOffice
> 
>

I suspect the problem is linked to processing the user configuration, maybe it spawns a separate thread and gets stuck somewhere. 

When the reported behaviour happens, the LO icon appears in the Dock, and the Dock icon context menu can be displayed (the entries are inactive), but nothing else is displayed while the process is seemingly stuck. Finder doesn't show the LO process as not responding, so there seems to be some kind of wait condition occurring.
Comment 6 Patrick (volunteer) 2025-02-08 15:40:46 UTC
(In reply to Alex Thurgood from comment #5)
> I suspect the problem is linked to processing the user configuration, maybe
> it spawns a separate thread and gets stuck somewhere. 

How about attaching an Activity Monitor sample then?
Comment 7 Alex Thurgood 2025-02-10 15:55:10 UTC
(In reply to Patrick (volunteer) from comment #6)

 
> How about attaching an Activity Monitor sample then?

I tried this today after a homebrew update of the existing 24.8 to 25.2, but unfortunately wasn't able to get anything useful out of the trace other than noticing that a lot of network traffic seemed to be happening, but this could be unrelated to LO.

After 3 minutes, I stopped tracing, and LO finally brought up the StartCenter after 5 minutes of just sitting there in the Dock. So it does come up eventually, but obviously well outside the normal range of a few seconds from double-click to displaying the StartCenter.
Comment 8 Patrick (volunteer) 2025-02-12 22:54:23 UTC
If you aren't seeing a hang, I wonder if the LibreOffice code is in a long-running loop? Maybe if you can get 2 or 3 Activity Monitor samples in a row, the samples will all similar to the one you posted in tdf#165202, but instead of a lock() at the bottom of the main thread's stack, the bottom of the stack will change but the functions higher up the stack will be the same in each sample. That usually hints that the problem is an infinite or long-running loop.

Might not help, but maybe it will narrow down where in the LibreOffice code this bug is occurring in.
Comment 9 Alex Thurgood 2025-02-13 10:11:38 UTC
Created attachment 199183 [details]
Spindump whilst waiting for LibreOffice to display StartCenter

I managed to get this spindump of the LO process with the LO icon in the Dock, and waiting for the StartCenter to be displayed.

This was tested with :

Version: 24.8.3.2 (AARCH64) / LibreOffice Community
Build ID: 48a6bac9e7e268aeb4c3483fcf825c94556d9f92
CPU threads: 8; OS: macOS 15.2; UI render: Skia/Raster; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 10 Alex Thurgood 2025-02-13 10:13:15 UTC
Created attachment 199184 [details]
Spindump after StartCenter is displayed

This is the spindump after the StartCenter is displayed. It might be possible to compare the two to spot any glaring differences.
Comment 11 Patrick (volunteer) 2025-02-13 14:24:03 UTC
(In reply to Alex Thurgood from comment #9)
> Created attachment 199183 [details]
> Spindump whilst waiting for LibreOffice to display StartCenter
> 
> I managed to get this spindump of the LO process with the LO icon in the
> Dock, and waiting for the StartCenter to be displayed.

Your sample is really unexpected. It looks like LibreOffice is stuck in the very earliest phases of launching an application. From what I can see, LibreOffice has not executed much, if any, of its own code yet. Instead, LibreOffice is stuck very earlier in the main() function. The native event loop hasn't started  and libvcl has not even been loaded.

The sample shows LibreOffice is spending a lot of time in the fstat() system function which is called by main(). Since fstat() just returns information about a file (e.g. file size, timestamps, permissions), that function shouldn't hang unless the file is on a remote volume.

Is LibreOffice installed on or is your home folder on a remote volume?
Comment 12 Alex Thurgood 2025-02-13 16:51:45 UTC
(In reply to Patrick (volunteer) from comment #11)



> 
> Is LibreOffice installed on or is your home folder on a remote volume?

The app bundle is in the default Applications folder, and the user config folder in 

/Users/alex/Library/Application Support/

all on Macintosh HD
Comment 13 Patrick (volunteer) 2025-02-14 00:32:13 UTC
(In reply to Alex Thurgood from comment #12)
> all on Macintosh HD

Well I'm stumped. The only other thing I can think that would block fstat() is anti-virus software. Not sure, but I assume that most anti-virus software is in a kernel extension.

Other than that, I noticed that we are both running on Silicon Macs, but you are running macOS 15.2 and I am running macOS 15.3. After some searching, I stumbled upon the following Apple Developer Forum post:

https://developer.apple.com/forums/thread/765433

That had something to do with accessing files and at the end it says that it was fixed in macOS 15.3. So possibly this is a macOS Sequoia bug that has already been fixed by Apple?