[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - common/SigUtil.cpp common/SigUtil.hpp
Michael Meeks
michael.meeks at collabora.com
Thu May 11 10:03:08 UTC 2017
common/SigUtil.cpp | 11 ++++++++---
common/SigUtil.hpp | 3 +++
2 files changed, 11 insertions(+), 3 deletions(-)
New commits:
commit cac5f0481c7430a6760b0fb45cca63690c76a1ca
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Fri Apr 28 18:08:57 2017 +0100
SigUtil: split out dumpBacktrace.
Change-Id: I33121de341051bf40ae0d42d1d6d44843d6d1e97
Reviewed-on: https://gerrit.libreoffice.org/37479
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/common/SigUtil.cpp b/common/SigUtil.cpp
index c6c4ffe4..48899f37 100644
--- a/common/SigUtil.cpp
+++ b/common/SigUtil.cpp
@@ -190,6 +190,14 @@ namespace SigUtil
sigaction(signal, &action, nullptr);
+ dumpBacktrace();
+
+ // let default handler process the signal
+ kill(Poco::Process::id(), signal);
+ }
+
+ void dumpBacktrace()
+ {
char header[32];
sprintf(header, "Backtrace %d:\n", getpid());
@@ -224,9 +232,6 @@ namespace SigUtil
LOG_ERR("Sleeping 30s to allow debugging.");
sleep(30);
}
-
- // let default handler process the signal
- kill(Poco::Process::id(), signal);
}
void setFatalSignals()
diff --git a/common/SigUtil.hpp b/common/SigUtil.hpp
index 2b69578a..7cc8f6d7 100644
--- a/common/SigUtil.hpp
+++ b/common/SigUtil.hpp
@@ -56,6 +56,9 @@ namespace SigUtil
/// after a certain (short) timeout.
bool killChild(const int pid);
+ /// Dump a signal-safe back-trace
+ void dumpBacktrace();
+
} // end namespace SigUtil
#endif
More information about the Libreoffice-commits
mailing list