diff options
author | David Goulet <dgoulet@torproject.org> | 2019-09-09 10:51:19 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-09-09 10:51:19 -0400 |
commit | 1e7c7870e87ff660d4dce0b381790993be0328eb (patch) | |
tree | 737819836bae1be38d12b6058d28362457a80cbd /src/lib/err/torerr.c | |
parent | 545c21e23dcb2c73ab9d9f33e2ea6906a230b4b5 (diff) | |
parent | 193c74faf9c4c4dd32789e89cfd3f40291842524 (diff) | |
download | tor-1e7c7870e87ff660d4dce0b381790993be0328eb.tar.gz tor-1e7c7870e87ff660d4dce0b381790993be0328eb.zip |
Merge branch 'tor-github/pr/1287'
Diffstat (limited to 'src/lib/err/torerr.c')
-rw-r--r-- | src/lib/err/torerr.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/err/torerr.c b/src/lib/err/torerr.c index 6cf213e7c4..48fcf35e06 100644 --- a/src/lib/err/torerr.c +++ b/src/lib/err/torerr.c @@ -154,14 +154,21 @@ 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 ", - file, ":", linebuf, ": ", expr, NULL); + tor_log_err_sigsafe("INTERNAL ERROR: Raw assertion failed in ", + get_tor_backtrace_version(), " at ", + file, ":", linebuf, ": ", expr, "\n", NULL); if (msg) { tor_log_err_sigsafe_write(msg); tor_log_err_sigsafe_write("\n"); } dump_stack_symbols_to_error_fds(); + + /* Some platforms (macOS, maybe others?) can swallow the last write before an + * abort. This issue is probably caused by a race condition between write + * buffer cache flushing, and process termination. So we write an extra + * newline, to make sure that the message always gets through. */ + tor_log_err_sigsafe_write("\n"); } /* As format_{hex,dex}_number_sigsafe, but takes a <b>radix</b> argument |