updated segfault handler
authoraidan
Wed, 22 Jun 2011 15:06:06 +0100
changeset 14 06512deddac4
parent 13 841ab1482c9c
child 15 65e62bd13efd
updated segfault handler
servlib/bundling/BundleDaemon.cc
servlib/bundling/BundleDaemon.h
--- a/servlib/bundling/BundleDaemon.cc	Wed Jun 22 13:58:21 2011 +0100
+++ b/servlib/bundling/BundleDaemon.cc	Wed Jun 22 15:06:06 2011 +0100
@@ -2867,7 +2867,9 @@
     size = backtrace(array, 10);
 
     // print out all the frames to stderr
+    //log_err(stderr, "Error: signal %d:\n", sig);
     fprintf(stderr, "Error: signal %d:\n", sig);
+
     backtrace_symbols_fd(array, size, 2);
     exit(1);
 }
@@ -2877,6 +2879,8 @@
 BundleDaemon::run()
 {
     static const char* LOOP_LOG = "/dtn/bundle/daemon/loop";
+
+    signal(SIGSEGV, handle_sigsegv);
     
     if (! BundleTimestamp::check_local_clock()) {
         exit(1);
--- a/servlib/bundling/BundleDaemon.h	Wed Jun 22 13:58:21 2011 +0100
+++ b/servlib/bundling/BundleDaemon.h	Wed Jun 22 15:06:06 2011 +0100
@@ -311,7 +311,7 @@
     /**
      *
      */
-    void handle_sigsegv(int sig);
+//    void handle_sigsegv(int sig);
 
     /**
      * Main event handling function.