summaryrefslogtreecommitdiffstats
path: root/kdesktop/lock/lockprocess.cc
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-12-01 22:14:28 -0600
committerTimothy Pearson <[email protected]>2012-12-01 22:14:28 -0600
commit786e248cea658856ef647b7ab8d3e8cf7c057918 (patch)
treed9aa63988d29e5b1837f6049c4806b191565407c /kdesktop/lock/lockprocess.cc
parenta7c1897e9f5cc0aaca689227c25a6a70ec827cc0 (diff)
downloadtdebase-786e248cea658856ef647b7ab8d3e8cf7c057918.tar.gz
tdebase-786e248cea658856ef647b7ab8d3e8cf7c057918.zip
Add backtrace to kdesktop_lock exception handler
Diffstat (limited to 'kdesktop/lock/lockprocess.cc')
-rw-r--r--kdesktop/lock/lockprocess.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc
index 3c37090a6..70836c26c 100644
--- a/kdesktop/lock/lockprocess.cc
+++ b/kdesktop/lock/lockprocess.cc
@@ -18,6 +18,8 @@
#include <config.h>
+#include <execinfo.h>
+
#include "lockprocess.h"
#include "lockdlg.h"
#include "infodlg.h"
@@ -129,9 +131,29 @@ static Window gVRootData = 0;
static Atom gXA_VROOT;
static Atom gXA_SCREENSAVER_VERSION;
+void print_trace()
+{
+ void *array[10];
+ size_t size;
+ char **strings;
+ size_t i;
+
+ size = backtrace (array, 10);
+ strings = backtrace_symbols (array, size);
+
+ printf ("[kdesktop_lock] Obtained %zd stack frames.\n\r", size);
+
+ for (i = 0; i < size; i++) {
+ printf ("[kdesktop_lock] %s\n\r", strings[i]);
+ }
+
+ free (strings);
+}
+
static void segv_handler(int)
{
printf("[kdesktop_lock] WARNING: A fatal exception was encountered. Trapping and ignoring it so as not to compromise desktop security...\n\r");
+ print_trace();
sleep(1);
}