Summary: | Performance: Libreoffice hangs on first launch after boot for 30-60 seconds on intel mac maybe due to custom font(s) | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | steve <lo> |
Component: | LibreOffice | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | RESOLVED NOTOURBUG | ||
Severity: | minor | CC: | guibomacdev |
Priority: | medium | Keywords: | perf |
Version: | 7.6.0.0 alpha0+ | ||
Hardware: | x86-64 (AMD64) | ||
OS: | macOS (All) | ||
See Also: |
https://bugs.documentfoundation.org/show_bug.cgi?id=152524 https://bugs.documentfoundation.org/show_bug.cgi?id=146852 |
||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Attachments: |
2024-04-16 Sample of LibreOfficeDev while hanging
2024-04-17 process sample 2024-04-19 process sample |
Description
steve
2024-04-16 21:22:12 UTC
This is the mac where reproducing the delay is possible: Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 71efd6046488b952f679936ea1c4a415f4989b18 CPU threads: 8; OS: macOS 13.6.6; UI render: Skia/Metal; VCL: osx Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded Created attachment 193713 [details]
2024-04-16 Sample of LibreOfficeDev while hanging
(In reply to steve from comment #2) > Created attachment 193713 [details] > 2024-04-16 Sample of LibreOfficeDev while hanging Interestingly, your sample shows LibreOffice is loading all of fonts for the Font combobox in the toolbar. I don't see any GPG code in your sample so I wonder if one or more fonts are loading very slowly. If you validate all your fonts using the steps in the following comment, are there any fonts with warnings or errors? If yes, does deactivating or removing them stop or reduce the hang?: https://bugs.documentfoundation.org/show_bug.cgi?id=160644#c7 Created attachment 193732 [details]
2024-04-17 process sample
2 minor problems were found, so both fonts were removed.
The hang seems to only happen after a restart. And when it has happened it does not happen on a second opening. LibreOfficeDev shows as "Not responding" in Activity Monitor when the hang happens.
Attaching another process sample.
(In reply to steve from comment #4) > Created attachment 193732 [details] > 2024-04-17 process sample > > 2 minor problems were found, so both fonts were removed. > > The hang seems to only happen after a restart. And when it has happened it > does not happen on a second opening. LibreOfficeDev shows as "Not > responding" in Activity Monitor when the hang happens. > > Attaching another process sample. Your latest sample is hanging in the same place: loading fonts. It makes sense that this hang only happens on the first launch of LibreOffice after rebooting. The reason is that once a font is first loaded, macOS keeps it cached in memory so that LibreOffice and any other applications can use the font quickly. But for some reason, one or more of your fonts are very slow to load. The problem is how do we identify which font? Do you have any non-system fonts installed in the "My Fonts" sidebar item in the Font Book application? Does deactivating those fonts and rebooting stop the hang? (In reply to Patrick Luby (volunteer) from comment #5) > But for some reason, one or more of your fonts are very slow to load. The > problem is how do we identify which font? Do you have any non-system fonts > installed in the "My Fonts" sidebar item in the Font Book application? Does > deactivating those fonts and rebooting stop the hang? After thinking a bit more about this, I think the problem is likely an unusually large font file. Both samples show a memcpy() at the bottom of the main thread so I am guessing that the size of the glyph table that is being copied from the font file is very large. So, before you spend any time rebooting, can you look at your fonts in the My Fonts section of the Font Book application. Right-click on each font and select the "Show in Finder" popup menu item to see the file size of the font in the Finder. For comparison, one of the largest font files bundled with macOS is the Apple Color Emoji font file and, at least on macOS Sonoma 14.4.1, it shows 188.3 MB in size in the Finder. So if you see a similar sized or larger font file, I can try installing that font on my machine and see if I can reproduce this bug. adjusted title to reflect correct problem Created attachment 193750 [details]
2024-04-19 process sample
Disabled all fonts in the "My Fonts" section of Font Book app and restarted the mac.
Adding another process sample of LO still hanging on launch.
I opened the fonts in finder and sorted by size. The largest font is songti (macOS font) which I cannot deactivate or delete. This seems to be true for the largest fonts in file size.
From the custom fonts the sf-fonts are the largest.
This seems a hard to investigate problem. Not sure if it is worth further investigating. I can not reproduce on an Apple Silicon mac. If you have other ideas, please let me know and happy to try, if not, also fine to close this bug.
(In reply to steve from comment #8) > This seems a hard to investigate problem. Not sure if it is worth further > investigating. I can not reproduce on an Apple Silicon mac. If you have > other ideas, please let me know and happy to try, if not, also fine to close > this bug. I cannot reproduce this bug either on macOS 14.4.1 Sonoma on my Silicon MacBook Pro. Your latest sample is identical to the previous two samples: macOS is stuck copy bytes from a font file. To me, that seems really unusual as the font has been loaded, we've already allocated memory for the copy of the font table, but your samples show LibreOffice is stuck in a memcpy(). I see the com.apple.NSEventThread thread further down in your sample in an apparent loop that is allocating memory. That thread is not LibreOffice code, however, and is a thread created by the macOS code so maybe that is the ultimate cause of the hang. But, since both the stuck thread and the com.apple.NSEventThread thread are internal macOS code, I'll close as "notourbug". |