aboutsummaryrefslogtreecommitdiff
path: root/src/lib/err/backtrace.c
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-09-20 11:40:05 +1000
committerteor <teor@torproject.org>2019-09-26 12:07:25 +1000
commit315f14c709d019c55731faedb19a97b771f9c42f (patch)
tree50b3a3755b94bb2629a8ae8dbe3ac76e05f254f7 /src/lib/err/backtrace.c
parentab7bfdf40402449d6a2214e1dd5bc3fe5bc9a2e7 (diff)
downloadtor-315f14c709d019c55731faedb19a97b771f9c42f.tar.gz
tor-315f14c709d019c55731faedb19a97b771f9c42f.zip
backtrace: avoid undefined behaviour on re-initialisation
cb_buf_mutex is statically initialised, so we can not destroy it when we are shutting down the err subsystem. If we destroy it, and then re-initialise tor, all our backtraces will fail. Part of 31736, but committed in this branch to avoid merge conflicts.
Diffstat (limited to 'src/lib/err/backtrace.c')
-rw-r--r--src/lib/err/backtrace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/err/backtrace.c b/src/lib/err/backtrace.c
index bf833c1621..2a956e6115 100644
--- a/src/lib/err/backtrace.c
+++ b/src/lib/err/backtrace.c
@@ -251,6 +251,10 @@ remove_bt_handler(void)
* It's not a fatal error, so we just ignore it. */
(void)sigaction(trap_signals[i], &sa, NULL);
}
+
+ /* cb_buf_mutex is statically initialised, so we can not destroy it.
+ * If we destroy it, and then re-initialise tor, all our backtraces will
+ * fail. */
}
#endif /* defined(USE_BACKTRACE) */