mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
torerr: Log the Tor backtrace version when a raw assertion fails
Part of 31571.
This commit is contained in:
parent
743bc0028b
commit
65a1d86491
@ -261,6 +261,14 @@ dump_stack_symbols_to_error_fds(void)
|
||||
}
|
||||
#endif /* defined(NO_BACKTRACE_IMPL) */
|
||||
|
||||
/** Return the tor version used for error messages on crashes.
|
||||
* Signal-safe: returns a pointer to a static array. */
|
||||
const char *
|
||||
get_tor_backtrace_version(void)
|
||||
{
|
||||
return bt_version;
|
||||
}
|
||||
|
||||
/** Set up code to handle generating error messages on crashes. */
|
||||
int
|
||||
configure_backtrace_handler(const char *tor_version)
|
||||
|
@ -21,6 +21,7 @@ void log_backtrace_impl(int severity, int domain, const char *msg,
|
||||
int configure_backtrace_handler(const char *tor_version);
|
||||
void clean_up_backtrace_handler(void);
|
||||
void dump_stack_symbols_to_error_fds(void);
|
||||
const char *get_tor_backtrace_version(void);
|
||||
|
||||
#define log_backtrace(sev, dom, msg) \
|
||||
log_backtrace_impl((sev), (dom), (msg), tor_log)
|
||||
|
@ -144,7 +144,8 @@ tor_raw_assertion_failed_msg_(const char *file, int line, const char *expr,
|
||||
{
|
||||
char linebuf[16];
|
||||
format_dec_number_sigsafe(line, linebuf, sizeof(linebuf));
|
||||
tor_log_err_sigsafe("INTERNAL ERROR: Raw assertion failed at ",
|
||||
tor_log_err_sigsafe("INTERNAL ERROR: Raw assertion failed in ",
|
||||
get_tor_backtrace_version(), " at ",
|
||||
file, ":", linebuf, ": ", expr, NULL);
|
||||
if (msg) {
|
||||
tor_log_err_sigsafe_write(msg);
|
||||
|
Loading…
Reference in New Issue
Block a user