[GHC] #10414: Buggy behavior with threaded runtime (-N1 working, -N2 getting into <<loop>>)

GHC ghc-devs at haskell.org
Fri Jul 3 15:53:16 UTC 2015


#10414: Buggy behavior with threaded runtime (-N1 working, -N2 getting into
<<loop>>)
-------------------------------------+-------------------------------------
        Reporter:  exio4             |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 The actual cause of the <<loop>> here seems to be that two threads are
 each blocking on a black hole that is being evaluated, or more likely has
 been evaluated but not updated, by the other thread. I attached a complete
 `-Ds` log above, but the relevant lines are
 {{{
 ...
 0.011574 7ff6be7fc700: cap 1: thread 6 stopped (blocked on black hole
 owned by thread 5)
 ...
 0.011808 7ff6c6700740: cap 0: thread 5 stopped (blocked on black hole
 owned by thread 6)
 ...
 }}}
 I didn't work out exactly how this can arise, but it probably involves two
 single-entry thunks and two ordinary thunks whose evaluations force both
 of the single-entry thunks, but in different orders.

 Changing `blackHoleOnEntry` for single-entry thunks as suggested did fix
 `par2.hs`. I'm going to test the other examples in this ticket now.

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


More information about the ghc-tickets mailing list