[tor-bugs] #31594 [Core Tor/Tor]: Close all the log fds before aborting

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Sep 3 05:30:31 UTC 2019


#31594: Close all the log fds before aborting
-------------------------+-------------------------------------------------
     Reporter:  teor     |      Owner:  (none)
         Type:  defect   |     Status:  new
     Priority:  Medium   |  Milestone:  Tor: 0.4.2.x-final
    Component:  Core     |    Version:
  Tor/Tor                |   Keywords:  diagnostics, 042-should, android,
     Severity:  Normal   |  macos, 035-backport, 040-backport, 041-backport
Actual Points:           |  Parent ID:  #31571
       Points:  0.3      |   Reviewer:
      Sponsor:           |
-------------------------+-------------------------------------------------
 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()

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/31594>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list