diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-16 02:52:29 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-16 03:22:19 +0000 |
commit | e8c1727b37c7cdaec20407a38aeceec853b15d32 (patch) | |
tree | d548557c04275b4fccefe1839914878bcd6f5600 /sal | |
parent | df5235560730ff73729c496476a0be02eb8c4ac6 (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/signal.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
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 <sal/config.h> +#include <config_features.h> #include <signalshared.hxx> @@ -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; |