Tor  0.4.7.0-alpha-dev
Macros | Functions
util_bug.c File Reference
#include "orconfig.h"
#include "lib/log/util_bug.h"
#include "lib/log/log.h"
#include "lib/err/backtrace.h"
#include "lib/err/torerr.h"
#include "lib/malloc/malloc.h"
#include "lib/string/printf.h"
#include <string.h>
#include <stdlib.h>

Go to the source code of this file.

Macros

#define capturing_bugs()   (0)
 
#define add_captured_bug(s)   do { } while (0)
 

Functions

void tor_assertion_failed_ (const char *fname, unsigned int line, const char *func, const char *expr, const char *fmt,...)
 
void tor_bug_occurred_ (const char *fname, unsigned int line, const char *func, const char *expr, int once, const char *fmt,...)
 
void tor_abort_ (void)
 

Function Documentation

◆ tor_abort_()

void tor_abort_ ( void  )

Call the tor_raw_abort_() function to close raw logs, then kill the current process with a fatal error. But first, close the file-based log file descriptors, so error messages are written before process termination.

(This is a separate function so that we declare it in util_bug.h without including torerr.h in all the users of util_bug.h)

Definition at line 171 of file util_bug.c.

◆ tor_assertion_failed_()

void tor_assertion_failed_ ( const char *  fname,
unsigned int  line,
const char *  func,
const char *  expr,
const char *  fmt,
  ... 
)

Helper for tor_assert: report the assertion failure.

Definition at line 74 of file util_bug.c.

◆ tor_bug_occurred_()

void tor_bug_occurred_ ( const char *  fname,
unsigned int  line,
const char *  func,
const char *  expr,
int  once,
const char *  fmt,
  ... 
)

Helper for tor_assert_nonfatal: report the assertion failure.

Definition at line 106 of file util_bug.c.