servlib/bundling/BundleDaemon.cc
changeset 13 841ab1482c9c
parent 12 7463e4bb80e4
child 14 06512deddac4
--- a/servlib/bundling/BundleDaemon.cc	Wed Jun 22 13:07:38 2011 +0100
+++ b/servlib/bundling/BundleDaemon.cc	Wed Jun 22 13:58:21 2011 +0100
@@ -2858,6 +2858,22 @@
 
 //----------------------------------------------------------------------
 void
+handle_sigsegv(int sig)
+{
+    void *array[10];
+    size_t size;
+
+    // get void*'s for all entries on the stack
+    size = backtrace(array, 10);
+
+    // print out all the frames to stderr
+    fprintf(stderr, "Error: signal %d:\n", sig);
+    backtrace_symbols_fd(array, size, 2);
+    exit(1);
+}
+
+//----------------------------------------------------------------------
+void
 BundleDaemon::run()
 {
     static const char* LOOP_LOG = "/dtn/bundle/daemon/loop";