[tor-bugs] #31735 [Core Tor/Tor]: Exit and join all threads, before destroying any mutexes in the main thread
    Tor Bug Tracker & Wiki 
    blackhole at torproject.org
       
    Thu Sep 26 02:29:29 UTC 2019
    
    
  
#31735: Exit and join all threads, before destroying any mutexes in the main thread
--------------------------+----------------------------------
 Reporter:  teor          |          Owner:  (none)
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: unspecified
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:  diagnostics   |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+----------------------------------
Old description:
> Otherwise, the mutex could be locked by another thread, and destroying a
> locked mutex triggers undefined behaviour.
>
> Part of #31614.
New description:
 Otherwise, the mutex could be locked by another thread, and destroying a
 locked mutex triggers undefined behaviour.
 ~~Part of #31614.~~
 Updated to add:
 Instead of exiting and joining threads, we can initialize the mutex once,
 and never destroy it. If we use a sentinel value, like
 log_mutex_initialized, then we won't re-initialize the mutex when we re-
 initialize everything else.
--
Comment (by teor):
 Instead of exiting and joining threads, we can initialize the mutex once,
 and never destroy it. If we use a sentinel value, like
 log_mutex_initialized, then we won't re-initialize the mutex when we re-
 initialize everything else.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/31735#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
    
    
More information about the tor-bugs
mailing list