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

GHC ghc-devs at haskell.org
Mon May 18 02:28:27 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 michaelt):

 This came into my head again, and can be simplified, and I think
 clarified, like so:

 {{{#!hs
 import           Control.Parallel.Strategies
 import           System.Environment

 parConcatMapN :: Int -> Int -> (a -> [a]) -> a -> [a]
 parConcatMapN chunksize depth step =  go depth
     where go 0  = (:[])
           go n  = withStrategy (parListChunk chunksize rseq)
                  . concatMap (go (n-1))
                  . step

 main :: IO ()
 main = do
     depth:_ <- fmap (map read) getArgs
     print $ length (test depth)

 test depth = parConcatMapN 3 depth show 'x'
 -- i.e.  iterate (concatMap show) 'x' !! depth
 }}}

 We keep re-chunking, but do not respect the chunking we already did, in
 the would-be progress through

 {{{
 'x'
 '\'''x''\''
 '\'''\\''\'''\'''\'''x''\'''\'''\\''\'''\''
 ...

 }}}

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


More information about the ghc-tickets mailing list