2020-07-02 18:31:32 +02:00
|
|
|
From 519a5a5f87527a344ab04efa0947d5d8e75294e5 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jan Engelhardt <jengelh@inai.de>
|
|
|
|
Date: Sun, 28 Jun 2020 12:38:40 +0200
|
|
|
|
Subject: [PATCH] build: allow deactivating the crash handler at build time
|
|
|
|
(#1166)
|
|
|
|
|
|
|
|
SLADE's own crash handler has two problems:
|
|
|
|
|
|
|
|
* it inhibits the generation of a proper crashdump
|
|
|
|
|
|
|
|
* it calls functions that not async-signal safe and/or re-entrant,
|
|
|
|
such as malloc (by way of backtrace(3)), which can lead to a hang
|
|
|
|
when the initial crash happened in malloc,
|
|
|
|
|
|
|
|
Fixes: #1166
|
|
|
|
---
|
2024-11-27 17:39:40 +01:00
|
|
|
src/Application/SLADEWxApp.cpp | 2 +-
|
|
|
|
src/CMakeLists.txt | 4 ++++
|
|
|
|
2 files changed, 5 insertions(+), 1 deletion(-)
|
2020-07-02 18:31:32 +02:00
|
|
|
|
2024-11-27 14:49:02 +01:00
|
|
|
Index: SLADE-3.2.6/src/Application/SLADEWxApp.cpp
|
|
|
|
===================================================================
|
|
|
|
--- SLADE-3.2.6.orig/src/Application/SLADEWxApp.cpp
|
|
|
|
+++ SLADE-3.2.6/src/Application/SLADEWxApp.cpp
|
|
|
|
@@ -449,7 +449,7 @@ bool SLADEWxApp::OnInit()
|
2020-07-02 18:31:32 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Handle exceptions using wxDebug stuff, but only in release mode
|
|
|
|
-#ifdef NDEBUG
|
|
|
|
+#if defined(USE_CRASHHANDLER) && defined(NDEBUG)
|
|
|
|
wxHandleFatalExceptions(true);
|
|
|
|
#endif
|
|
|
|
|
2024-11-27 14:49:02 +01:00
|
|
|
Index: SLADE-3.2.6/src/CMakeLists.txt
|
|
|
|
===================================================================
|
|
|
|
--- SLADE-3.2.6.orig/src/CMakeLists.txt
|
|
|
|
+++ SLADE-3.2.6/src/CMakeLists.txt
|
|
|
|
@@ -41,3 +41,7 @@ if (WIN32 AND MSVC)
|
|
|
|
else ()
|
|
|
|
include("unix") # Linux or MacOS
|
|
|
|
endif ()
|
2020-07-02 18:31:32 +02:00
|
|
|
+if (NOT NO_CRASHHANDLER)
|
|
|
|
+ add_definitions(-DUSE_CRASHHANDLER)
|
|
|
|
+endif ()
|
|
|
|
+
|