tor  0.4.1.0-alpha-dev
Macros | Functions
backtrace.c File Reference
#include "orconfig.h"
#include "lib/err/torerr.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "lib/err/backtrace.h"

Go to the source code of this file.

Macros

#define EXPOSE_CLEAN_BACKTRACE
 
#define NO_BACKTRACE_IMPL
 
#define raw_free   free
 

Functions

void log_backtrace_impl (int severity, int domain, const char *msg, tor_log_fn logger)
 
static int install_bt_handler (const char *software)
 
static void remove_bt_handler (void)
 
void dump_stack_symbols_to_error_fds (void)
 
int configure_backtrace_handler (const char *tor_version)
 
void clean_up_backtrace_handler (void)
 

Detailed Description

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.

Function Documentation

◆ clean_up_backtrace_handler()

void clean_up_backtrace_handler ( void  )

Perform end-of-process cleanup for code that generates error messages on crashes.

Definition at line 283 of file backtrace.c.

◆ configure_backtrace_handler()

int configure_backtrace_handler ( const char *  tor_version)

Set up code to handle generating error messages on crashes.

Definition at line 269 of file backtrace.c.