https://bugs.documentfoundation.org/show_bug.cgi?id=152524

Patrick Luby <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|[email protected] |[email protected]
                   |desktop.org                 |

--- Comment #32 from Patrick Luby <[email protected]> ---
(In reply to steve from comment #31)
> Sorry, didn't read comment 24 thoroughly enough.
> 
> Opening LO via the following command on macOS 13.6.4, where I otherwise see
> the lag / crash on open, resolves the crashes:
> 
>   export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
>   /Applications/LibreOffice.app/Contents/MacOS/soffice
> 
> LO opens fine, beachball of death does not show and document can almost
> instantly be interacted with.
> 
> Amazing you found this glitch. What is the way forward here on the long run?
> Is this something that needs to be fixed by Apple in macOS?

This is very good news. The way I found this was by searching on all the
unknown function names in the crash log window in the screen snapshot attached
to this bug combined with "fork() crash" until I bumped into the Python blog in
comment 24.

That's where it all started to make sense: Apple changed the Objective-C
runtime if you build with the Ventura SDK or newer. This is a common way that
Apple introduces macOS changes: they enable changes based on the macOS SDK
version that you build with. Build with an older SDK, you get Apple's old code.
But then when you start building with a newer SDK, that is when start seeing
the effects of these subtle Apple changes.

The simplest solution is to set the "__DATA,__objc_fork_ok" attribute in the
LibreOffice executable during the build. That shouldn't be difficul and that
should force LibreOffice to have the same behavior as setting
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES does in the Terminal.

My only worry is that Apple arbitrary decides to deprecated and ignore that
attribute in the future. So, before I implement the simple solution, I want
check if there is something obvious causing this crash. My first guess from
your 
"lag / crash on open" is that LibreOffice is launching gpg very early stages of
LibreOffice's launch process and runs gpg on a separate thread. The problem if
that is the case is that if the separate gpg thread is run early enough in the
launch process, the main thread will still be in the middle of loading
Objective-C classes and it is the loading of such classes that crashes all of
this new "fork() safety" feature in macOS.

I'll post when I have more news in the next few days. In the meantime, at least
we know about the temporary workaround in comment #30.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to