go-libreofficekit icon indicating copy to clipboard operation
go-libreofficekit copied to clipboard

fatal error: non-Go code set up signal handler without SA_ONSTACK flag

Open cdevienne opened this issue 4 years ago • 6 comments

Using go-libreofficekit I have this error message coming up:

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)

To avoid it I had to recompile libreoffice with the following patch:

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));

I will attempt to report the problem to the libreoffice project but meanwhile we have a workaround.

cdevienne avatar Feb 05 '21 14:02 cdevienne

I reported the issue to the libreoffice project: https://bugs.documentfoundation.org/show_bug.cgi?id=140189

cdevienne avatar Feb 05 '21 15:02 cdevienne

Not ideal, but a workaround I've used is to use Go 1.13.

1.14+ seems to throw this error

echarrod avatar Mar 23 '21 10:03 echarrod

any new??

xellDart avatar Apr 23 '21 00:04 xellDart

The issue in the libreoffice bugtracker is still "UNCONFIRMED", so for now we still use our recompiled libreoffice (and it works well).

I just changed the bug status to "NEW", as I am not the only one to have the issue (see https://wiki.documentfoundation.org/QA/BugReport/fr#Status)

cdevienne avatar Apr 23 '21 07:04 cdevienne

Anyone come up with other choices besides compiling their own libreoffice? I'd like to be able to use Go Modules to vendor packages, and need to make it up to 1.14

tehdiplomat avatar Nov 05 '21 13:11 tehdiplomat