commit 028733e8b6f36bae420b1e41897401fa3b14ccf8
Merge: 3aaa4d416 ebce7059f
Author: George Kadianakis <desnac...@riseup.net>
Date:   Thu Sep 12 18:09:35 2019 +0300

    Merge branch 'tor-github/pr/1303'

 changes/bug31594            |  5 +++
 src/lib/err/backtrace.c     |  2 +-
 src/lib/err/torerr.c        | 64 +++++++++++++++++++++++++++++++---
 src/lib/err/torerr.h        |  7 ++--
 src/lib/err/torerr_sys.c    |  5 ++-
 src/lib/log/log.c           | 85 +++++++++++++++++++++++++++++++++++++++------
 src/lib/log/log.h           |  1 +
 src/lib/log/util_bug.c      | 11 +++---
 src/trunnel/trunnel-local.h |  1 +
 9 files changed, 158 insertions(+), 23 deletions(-)

diff --cc src/lib/err/torerr.c
index 48fcf35e0,21b28a5f6..0a4ee5d41
--- a/src/lib/err/torerr.c
+++ b/src/lib/err/torerr.c
@@@ -163,14 -206,20 +207,26 @@@ tor_raw_assertion_failed_msg_(const cha
    }
  
    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");
  }
  
+ /**
+  * Call the abort() function to kill the current process with a fatal
+  * error. But first, close the raw error file descriptors, so error messages
+  * are written before process termination.
+  **/
+ void
+ tor_raw_abort_(void)
+ {
+   tor_log_close_sigsafe_err_fds();
+   abort();
+ }
+ 
  /* As format_{hex,dex}_number_sigsafe, but takes a <b>radix</b> argument
   * in range 2..16 inclusive. */
  static int

_______________________________________________
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to