Tor 0.4.9.1-alpha-dev
|
Functions to produce backtraces on bugs, crashes, or assertion failures. More...
#include "orconfig.h"
#include "lib/err/torerr.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "lib/cc/ctassert.h"
#include "lib/err/backtrace.h"
Go to the source code of this file.
Macros | |
#define | BACKTRACE_PRIVATE |
#define | NO_BACKTRACE_IMPL |
#define | raw_free free |
Functions | |
void | log_backtrace_impl (int severity, log_domain_mask_t domain, const char *msg, tor_log_fn logger) |
static int | install_bt_handler (void) |
static void | remove_bt_handler (void) |
void | dump_stack_symbols_to_error_fds (void) |
const char * | get_tor_backtrace_version (void) |
int | configure_backtrace_handler (const char *tor_version) |
void | clean_up_backtrace_handler (void) |
Variables | |
static char | bt_version [128] = "" |
Functions to produce backtraces on bugs, crashes, or assertion failures.
Currently, we've only got an implementation here using the backtrace() family of functions, which are sometimes provided by libc and sometimes provided by libexecinfo. We tie into the sigaction() backend in order to detect crashes.
This is one of the lowest-level modules, since nearly everything needs to be able to log an error. As such, it doesn't call the log module or any other higher-level modules directly.
Definition in file backtrace.c.
#define BACKTRACE_PRIVATE |
Definition at line 57 of file backtrace.c.
#define NO_BACKTRACE_IMPL |
Definition at line 67 of file backtrace.c.
#define raw_free free |
Definition at line 71 of file backtrace.c.
void clean_up_backtrace_handler | ( | void | ) |
Perform end-of-process cleanup for code that generates error messages on crashes.
Definition at line 359 of file backtrace.c.
int configure_backtrace_handler | ( | const char * | tor_version | ) |
Set up code to handle generating error messages on crashes.
Definition at line 330 of file backtrace.c.
void dump_stack_symbols_to_error_fds | ( | void | ) |
Definition at line 315 of file backtrace.c.
const char * get_tor_backtrace_version | ( | void | ) |
Return the tor version used for error messages on crashes. Signal-safe: returns a pointer to a static array.
Definition at line 323 of file backtrace.c.
Referenced by tor_raw_assertion_failed_msg_().
|
static |
Definition at line 304 of file backtrace.c.
void log_backtrace_impl | ( | int | severity, |
log_domain_mask_t | domain, | ||
const char * | msg, | ||
tor_log_fn | logger | ||
) |
Definition at line 296 of file backtrace.c.
|
static |
Definition at line 310 of file backtrace.c.
|
static |
Version of Tor to report in backtrace messages.
Definition at line 74 of file backtrace.c.
Referenced by get_tor_backtrace_version().