Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 06/19/2012 04:20 PM, Michael Meeks wrote:
On Tue, 2012-06-19 at 15:43 +0200, Stephan Bergmann wrote:
On 06/19/2012 02:52 PM, Michael Meeks wrote:
        It -looks- like you do this on every startup, when in fact we really
only want to do it -before- we run 'exec' in this rather rare re-start
condition :-)

For the given scenario, we really only need to do it *after* exec under
the restart condition on Mac OS X (not *before,* due to additional
threads still running then that must not be irritated by closing fds
they still operate on).  So doing it upon *every* start on Mac OS X
appeared to be the easiest fix.

        Grief - but calling 'exec' is unlikely to leave the threads around of
the previous process in some unharmed state - surely it will just
terminate them all [ presumably that is what we want ;-].

No, it will surely not leave them around after exec, but if we close fds before exec, they will get in our way, leading to nasty signals or deadlocks (witness the rtl allocator machinery threads, where that machinery is using fd based memory regions).

        If not, a quick:

        if (!fork()) {
                // close all sockets
                exec (...);
        }

        Would presumably do what we want (?) :-)

No, the whole exercise (with exec from self on Mac OS X) is only there to prevent forking in the first place (which would confuse Mac OS X's view of what the LO process actually is).

Hopefully we're not counting
on some configuration writer thread to write the config :-)

That should hopefully not be the case. (And esp. in the restart-after-crash scenario, the process is in an indeterminate state where all bets are off anyway.) The configmgr writer thread writes a copy first and moves it to registrymodifications.xcu in what is hopefully an atomic operation.

Stephan

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.