Skip to content

Close all the log fds before aborting

We should close the sigsafe_log_fds before abort(), so that we are less likely to lose log lines in the fd buffers.

Here are the abort() users:

  • tor_abort_()
  • crash_handler()
  • format_number_sigsafe()
  • raw_assert()
  • raw_assert_unreached_msg()
  • trunnel_abort()

We could:

  • define a raw_abort() function that closes the fds
  • use it instead of abort()
  • #define trunnel_abort() as raw_abort()
  • update our C linter to require raw_abort() instead of abort()
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information