diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-07-19 14:09:58 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-11-18 10:43:14 -0500 |
commit | 063bea58bcc1c27864a0351bba07254855903377 (patch) | |
tree | 8a0f0ea303fbbc4b86d31c54dd9da761f658f4e2 /src/or/main.c | |
parent | f6d8bc9389db72dc654560d0f86fd3edd3b14934 (diff) | |
download | tor-063bea58bcc1c27864a0351bba07254855903377.tar.gz tor-063bea58bcc1c27864a0351bba07254855903377.zip |
Basic backtrace ability
On platforms with the backtrace/backtrace_symbols_fd interface, Tor
can now dump stack traces on assertion failure. By default, I log
them to DataDir/stack_dump and to stderr.
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/main.c b/src/or/main.c index d1728250a4..ea86df0738 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -12,6 +12,7 @@ #include "or.h" #include "addressmap.h" +#include "backtrace.h" #include "buffers.h" #include "channel.h" #include "channeltls.h" @@ -2304,7 +2305,7 @@ handle_signals(int is_parent) int tor_init(int argc, char *argv[]) { - char buf[256]; + char progname[256]; int i, quiet = 0; time_of_process_start = time(NULL); if (!connection_array) @@ -2314,8 +2315,8 @@ tor_init(int argc, char *argv[]) if (!active_linked_connection_lst) active_linked_connection_lst = smartlist_new(); /* Have the log set up with our application name. */ - tor_snprintf(buf, sizeof(buf), "Tor %s", get_version()); - log_set_application_name(buf); + tor_snprintf(progname, sizeof(progname), "Tor %s", get_version()); + log_set_application_name(progname); /* Initialize the history structures. */ rep_hist_init(); /* Initialize the service cache. */ @@ -2684,6 +2685,8 @@ tor_main(int argc, char *argv[]) } #endif + configure_backtrace_handler(NULL, get_version()); + update_approx_time(time(NULL)); tor_threads_init(); init_logging(); |