[Libreoffice-bugs] [Bug 140189] New: libreofficekit & golang: fatal error: non-Go code set up signal handler without SA_ONSTACK flag

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Feb 5 15:10:58 UTC 2021


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

            Bug ID: 140189
           Summary: libreofficekit & golang: fatal error: non-Go code set
                    up signal handler without SA_ONSTACK flag
           Product: LibreOffice
           Version: 7.1.0.3 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: christophe at cdevienne.info

Created attachment 169502
  --> https://bugs.documentfoundation.org/attachment.cgi?id=169502&action=edit
Enable SA_STACK flag

Trying to use https://github.com/dveselov/go-libreofficekit I get the following
errors:

"""
signal 23 received but handler not on signal stack
fatal error: non-Go code set up signal handler without SA_ONSTACK flag

runtime stack:
runtime: unexpected return pc for runtime.sigtramp called from 0x7f25a7ad1228
stack: frame={sp:0xc000078ed8, fp:0xc000078f30}
stack=[0xc000070e08,0xc000079208)
"""

Applying the attached patch on the latest release (7.1.0.3) fixed the issue,
but I don't know if it could be acceptable as is or if adding the SA_ONSTACK
flag should be done only with loading from libreofficekit in which case I have
no idea where to start.

Here is the patch I applied:


diff --git a/sal/osl/unx/signal.cxx b/sal/osl/unx/signal.cxx
index 79721def6c5e..0694fc3c7b26 100644
--- a/sal/osl/unx/signal.cxx
+++ b/sal/osl/unx/signal.cxx
@@ -197,7 +197,7 @@ bool onInitSignal()

     struct sigaction act;
     act.sa_sigaction = signalHandlerFunction;
-    act.sa_flags = SA_RESTART | SA_SIGINFO;
+    act.sa_flags = SA_RESTART | SA_SIGINFO | SA_ONSTACK;

     sigfillset(&(act.sa_mask));

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210205/a4b8db2a/attachment.htm>


More information about the Libreoffice-bugs mailing list