[GHC] #16150: Data races in itimer_thread_func reported by ThreadSanitizer

GHC ghc-devs at haskell.org
Thu Jan 17 17:47:05 UTC 2019


#16150: Data races in itimer_thread_func reported by ThreadSanitizer
-------------------------------------+-------------------------------------
        Reporter:  gnezdo            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Runtime System    |              Version:  8.4.4
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:  x86_64
 Type of failure:  Incorrect result  |  (amd64)
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"7b12b3f0240321ac1ee43f14eb9c07e015022eeb/ghc"
 7b12b3f0/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="7b12b3f0240321ac1ee43f14eb9c07e015022eeb"
 itimer: Don't free condvar until we know ticker is stopped

 When we are shutting down the pthread ticker we signal the start_cond
 condition
 variable to ensure that the ticker thread wakes up and exits in a
 reasonable
 amount of time. Previously, when the ticker thread would shut down it was
 responsible for freeing the start_cond condition variable. However, this
 would
 lead to a race wherein the ticker would free start_cond, then the main
 thread
 would try to signal it in an effort to wake the ticker (#16150).

 Avoid this by moving the mutex destruction to the main thread.
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16150#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list