[Libreoffice-commits] core.git: sal/osl

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 13 07:20:11 UTC 2019


 sal/osl/unx/process.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit c09d0209104ffce677cc3402f9ac844ab20a6d5b
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Aug 13 08:32:02 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Aug 13 09:19:37 2019 +0200

    Avoid non-async-signal-safe functionality after fork
    
    Triggering those SAL_WARN sporadically caused deadlocks at least for
    <https://ci.libreoffice.org/job/lo_ubsan/>.
    
    Change-Id: I7b7037e411c29eea26e63f71a5679127b084f447
    Reviewed-on: https://gerrit.libreoffice.org/77374
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx
index 1e3c7d372d69..41d6de0b04ea 100644
--- a/sal/osl/unx/process.cxx
+++ b/sal/osl/unx/process.cxx
@@ -175,7 +175,9 @@ static void ChildStatusProc(void *pData)
             OSL_ASSERT(geteuid() == 0);     /* must be root */
 
             if (! INIT_GROUPS(data.m_name, data.m_gid) || (setuid(data.m_uid) != 0))
-                SAL_WARN("sal.osl", "Failed to change uid and guid: " << UnixErrnoString(errno));
+            {
+                // ignore; can't do much about it here after fork
+            }
 
             unsetenv("HOME");
         }
@@ -234,12 +236,12 @@ static void ChildStatusProc(void *pData)
             execv(data.m_pszArgs[0], const_cast<char **>(data.m_pszArgs));
         }
 
-        SAL_WARN("sal.osl", "ChildStatusProc : Failed to exec <" << data.m_pszArgs[0] << ">: " << UnixErrnoString(errno));
-
         /* if we reach here, something went wrong */
         errno_copy = errno;
         if ( !safeWrite(channel[1], &errno_copy, sizeof(errno_copy)) )
-            SAL_WARN("sal.osl", "sendFdPipe : sending failed:  " << UnixErrnoString(errno));
+        {
+            // ignore; can't do much about it here after fork
+        }
 
         if ( channel[1] != -1 )
             close(channel[1]);


More information about the Libreoffice-commits mailing list