# HG changeset patch # User aidan # Date 1308747501 -3600 # Node ID 841ab1482c9c70ee82da6df79d1029460f80a672 # Parent 7463e4bb80e496d78b5e3aaafd9b34f1e57104b6 added missing #include to dtnquery and added a segfault handler to the bundle daemon (still need to test this) diff -r 7463e4bb80e4 -r 841ab1482c9c apps/dtnquery/dtnquery.c --- a/apps/dtnquery/dtnquery.c Wed Jun 22 13:07:38 2011 +0100 +++ b/apps/dtnquery/dtnquery.c Wed Jun 22 13:58:21 2011 +0100 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "dtn_api.h" #include "sdnv-c.h" diff -r 7463e4bb80e4 -r 841ab1482c9c servlib/bundling/BundleDaemon.cc --- 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"; diff -r 7463e4bb80e4 -r 841ab1482c9c servlib/bundling/BundleDaemon.h --- a/servlib/bundling/BundleDaemon.h Wed Jun 22 13:07:38 2011 +0100 +++ b/servlib/bundling/BundleDaemon.h Wed Jun 22 13:58:21 2011 +0100 @@ -35,6 +35,9 @@ #include "BundleStatusReport.h" #include "BPQBlock.h" +#include +#include + namespace dtn { class AdminRegistration; @@ -306,6 +309,11 @@ void run(); /** + * + */ + void handle_sigsegv(int sig); + + /** * Main event handling function. */ void handle_event(BundleEvent* event);