[Libreoffice-commits] core.git: desktop/unx uitest/libreoffice

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 8 06:51:34 UTC 2020


 desktop/unx/source/start.c       |    4 +++-
 uitest/libreoffice/connection.py |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 7b379661e6b99d103411a21b256a38fdc5357961
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Jun 8 07:37:21 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Jun 8 08:50:54 2020 +0200

    Reliably terminate soffice.bin when terminating soffice
    
    d58a3e5f85d44efc9d21dd56329a3ef20cb3692f "Reliably terminate soffice when
    connect throws an exception" had been a partial thinko:  When kill()'ing (i.e.,
    sending SIGKILL on POSIX) soffice (aka oosplash exec'ed from it), the
    soffice.bin forked from it can still keep on running.
    
    So terminate() (i.e., send SIGTERM on POSIX) soffice aka ooslpash, and in its
    sigterm_handler actually wait for the soffice.bin process.  (Where the latter
    should just be a saftey measure.  At least on POSIX, osl_terminateProcess as
    called from the oosplash sigterm_handler sends a SIGKILL, so should swiftly and
    reliably kill the soffice.bin process.)
    
    Change-Id: Ifd6930691dce34894e76c417e152111983d62b8c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95779
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index e3e5441bf97e..f95cfe4d1eaa 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -718,8 +718,10 @@ static void sigterm_handler(int ignored)
 {
     (void) ignored;
 
-    if (g_pProcess)
+    if (g_pProcess) {
         osl_terminateProcess(g_pProcess); // forward signal to soffice.bin
+        osl_joinProcess(g_pProcess);
+    }
 
     _exit(255);
 }
diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py
index 9de92e77312f..68330b47d6cf 100644
--- a/uitest/libreoffice/connection.py
+++ b/uitest/libreoffice/connection.py
@@ -57,7 +57,7 @@ class OfficeConnection:
             success = True
         finally:
             if not success and self.soffice:
-                self.soffice.kill()
+                self.soffice.terminate()
                 self.soffice.wait()
                 self.soffice = None
 


More information about the Libreoffice-commits mailing list