[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-bugs] #22565 [Core Tor/Tor]: Refactor tor's signal handler to avoid undefined behaviour



#22565: Refactor tor's signal handler to avoid undefined behaviour
------------------------------+-------------------------------------------
     Reporter:  teor          |      Owner:
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: unspecified
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:  memory-safety, technical-debt
Actual Points:                |  Parent ID:
       Points:  2             |   Reviewer:
      Sponsor:                |
------------------------------+-------------------------------------------
 A signal handler can be called at any time, including when Tor's data
 structures are in an inconsistent state.

 The C standard says that setting anything other than a sig_atomic_t flag
 in a signal handler is undefined behaviour. POSIX is slightly more
 permissive, but we still do far too much in our signal handler.

 Could we set flags and check them at the top of the event loop instead?
 Or are there things we must handle right away?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22565>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs