[GHC] #14356: "Main: thread blocked indefinitely in an MVar operation" in fixIO

GHC ghc-devs at haskell.org
Thu Oct 19 19:47:14 UTC 2017


#14356: "Main: thread blocked indefinitely in an MVar operation" in fixIO
-------------------------------------+-------------------------------------
        Reporter:  nickkuk           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:
       Component:  Runtime System    |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by nickkuk:

Old description:

> I'm not sure whether such behavior is expected, but this program
> {{{#!hs
> import System.IO
>
> main = fixIO (\x -> return 1) >>= print
> }}}
> prints "1"; and this
> {{{#!hs
> import System.IO
>
> main = fixIO (\(x, _) -> return (1, print x)) >>= print . fst
> }}}
> prints "Main: thread blocked indefinitely in an MVar operation".

New description:

 I'm not sure whether such behavior is expected, but this program
 {{{#!hs
 import System.IO

 main = fixIO (\x -> return 1) >>= print
 }}}
 prints "1"; and this
 {{{#!hs
 import System.IO

 main = fixIO (\(x, _) -> return (1, print x)) >>= print . fst
 }}}
 prints "Main: thread blocked indefinitely in an MVar operation". This
 behavior can be fixed with additional ~ as alexbiehl said below.

 Also, this program with mdo
 {{{#!hs
 {-# LANGUAGE RecursiveDo #-}

 main = mdo
   print x
   x <- return 1
   return ()
 }}}
 prints "Main: thread blocked indefinitely in an MVar operation".

--

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


More information about the ghc-tickets mailing list