diff options
author | teor <teor@torproject.org> | 2019-09-04 13:57:31 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-09-04 13:57:31 +1000 |
commit | 0cee6f498c1c9bb2f9fc05605bd0f11617d9d809 (patch) | |
tree | c8994714144b4c50860a6f5f652e88f8c746dfd7 /src/lib/err/torerr.c | |
parent | a52a5e0099f9201e0dc1a358b1ac7721070caf56 (diff) | |
parent | a836dd25309935edf74d993be1d437afdccc073a (diff) | |
download | tor-0cee6f498c1c9bb2f9fc05605bd0f11617d9d809.tar.gz tor-0cee6f498c1c9bb2f9fc05605bd0f11617d9d809.zip |
Merge branch 'bug31571_035' into bug31571_040
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 ecffb7f7bb..1a246e995c 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 |