@@ -81,6 +81,7 @@ typedef SInt32 SRefCon;
81
81
#if defined(linux) && !defined(ANDROID)
82
82
#include < unistd.h>
83
83
#include < execinfo.h>
84
+ #include < signal.h>
84
85
#endif
85
86
86
87
// (if Windows/Mac, use icon from resource)
@@ -193,6 +194,13 @@ LONG WINAPI qgisCrashDump( struct _EXCEPTION_POINTERS *ExceptionInfo )
193
194
}
194
195
#endif
195
196
197
+ #ifdef Q_OS_UNIX
198
+ void qgisCrash ( int signal )
199
+ {
200
+ qFatal ( " QGIS died on signal %d" , signal );
201
+ }
202
+ #endif
203
+
196
204
/*
197
205
* Hook into the qWarning/qFatal mechanism so that we can channel messages
198
206
* from libpng to the user.
@@ -270,6 +278,16 @@ int main( int argc, char *argv[] )
270
278
#if !defined(ANDROID) && !defined(_MSC_VER)
271
279
// Set up the custom qWarning/qDebug custom handler
272
280
qInstallMsgHandler ( myMessageOutput );
281
+
282
+ signal ( SIGQUIT, qgisCrash );
283
+ signal ( SIGILL, qgisCrash );
284
+ signal ( SIGFPE, qgisCrash );
285
+ signal ( SIGSEGV, qgisCrash );
286
+ signal ( SIGBUS, qgisCrash );
287
+ signal ( SIGSYS, qgisCrash );
288
+ signal ( SIGTRAP, qgisCrash );
289
+ signal ( SIGXCPU, qgisCrash );
290
+ signal ( SIGXFSZ, qgisCrash );
273
291
#endif
274
292
275
293
#ifdef Q_OS_WIN
0 commit comments