[GHC] #14356: "Main: thread blocked indefinitely in an MVar operation" in fixIO
GHC
ghc-devs at haskell.org
Thu Oct 19 14:21:04 UTC 2017
#14356: "Main: thread blocked indefinitely in an MVar operation" in fixIO
-------------------------------------+-------------------------------------
Reporter: nickkuk | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 8.2.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 Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Old description:
> I'm not sure whether such behavior is expected, but this program
> {{{
> import System.IO
>
> main = fixIO (\x -> return 1) >>= print
> }}}
> prints "1"; and this
> {{{
> import System.IO
>
> main = fixIO (\(x, _) -> return (1, print x)) >>= print . fst
> }}}
> prints "Main: thread blocked indefinitely in an MVar operation".
>
> Second program arises from something like
> {{{
> {-# LANUGAGE RecursiveDo #-}
>
> main = mdo
> ...
> x <- return 1
> let f = do
> ...
> print x
> ...
> ...
> return f
> }}}
> It is not necessary to call f somewhere in mdo to get "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".
Second program arises from something like
{{{#!hs
{-# LANUGAGE RecursiveDo #-}
main = mdo
...
x <- return 1
let f = do
...
print x
...
...
return f
}}}
It is not necessary to call f somewhere in mdo to get "Main: thread
blocked indefinitely in an MVar operation".
--
Comment (by bgamari):
David, could you look at this?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14356#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list