[GHC] #11508: QuickCheck application hangs with concurrent read/write of Chan

GHC ghc-devs at haskell.org
Mon Mar 28 00:57:39 UTC 2016


#11508: QuickCheck application hangs with concurrent read/write of Chan
-------------------------------------+-------------------------------------
        Reporter:  orion             |                Owner:
            Type:  bug               |               Status:  infoneeded
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:  x86_64
                                     |  (amd64)
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by erikd):

 Went away and did something else and then it occured to me that QuickCheck
 must be silently swallowing the "blocked MVar" exception.

 Looking at the code for `readChan` and `writeChan` from
 `Control.Concurrent.Chan` we can see that they are implemented with
 `MVars`. Interestingly, the docs for `Control.Concurrent.MVar` do warn
 about "race conditions, deadlocks or uncaught exceptions", but the docs
 for `Control.Concurrent.Chan` do not reflect this, and neither do they
 mention the `STM` implementation of channels in
 `Control.Concurrent.STM.TChan` which are far more robust than the `MVar`
 version.

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


More information about the ghc-tickets mailing list