From e8c1727b37c7cdaec20407a38aeceec853b15d32 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Mon, 16 May 2016 02:52:29 +0200 Subject: get breakpad signal handler working on windows The LibreOffice signal handler overwrites the breakpad signal handler. Just store the old handler and call that handler before we do any work in our own handler. Our own handler implementation is just insane as we are even trying to take the SolarMutex which can easily deadlock. Change-Id: I2401bba18701115561d00c7fc11138ead2a48205 Reviewed-on: https://gerrit.libreoffice.org/25022 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- sal/osl/w32/signal.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sal/osl/w32') diff --git a/sal/osl/w32/signal.cxx b/sal/osl/w32/signal.cxx index fb0eee0514ee..071df170bd84 100644 --- a/sal/osl/w32/signal.cxx +++ b/sal/osl/w32/signal.cxx @@ -18,6 +18,7 @@ */ #include +#include #include @@ -42,11 +43,13 @@ namespace { long WINAPI signalHandlerFunction(LPEXCEPTION_POINTERS lpEP); + +LPTOP_LEVEL_EXCEPTION_FILTER pPreviousHandler = nullptr; } bool onInitSignal() { - SetUnhandledExceptionFilter(signalHandlerFunction); + pPreviousHandler = SetUnhandledExceptionFilter(signalHandlerFunction); HMODULE hFaultRep = LoadLibrary( "faultrep.dll" ); if ( hFaultRep ) @@ -62,7 +65,7 @@ bool onInitSignal() bool onDeInitSignal() { - SetUnhandledExceptionFilter(nullptr); + SetUnhandledExceptionFilter(pPreviousHandler); return false; } @@ -74,6 +77,13 @@ namespace long WINAPI signalHandlerFunction(LPEXCEPTION_POINTERS lpEP) { +#if HAVE_FEATURE_BREAKPAD + // we should make sure to call the breakpad handler as + // first step when we hit a problem + if (pPreviousHandler) + pPreviousHandler(lpEP); +#endif + static bool bNested = false; oslSignalInfo info; -- cgit