#7400 closed bug (invalid)

Strange closure type 17 internal error

Reported by: ropoctl Owned by: simonmar
Priority: highest Milestone: 7.6.2
Component: Runtime System Version: 7.4.2
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Runtime crash Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

resample: internal error: evacuate(static): strange closure type 17

(GHC version 7.4.2 for x86_64_unknown_linux)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug

module Resample where

import Data.List
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy.Char8 as BL
import qualified Data.ByteString.Lazy as BB

import qualified Data.Vector as V
import System.Random.Mersenne
import Control.Monad (liftM, replicateM_)

readCollapsed :: FilePath -> IO [(Int, B.ByteString)]
readCollapsed f = ((map (either error id) . unfoldr parse) . BL.lines) `fmap` BL.readFile f

parse :: [BL.ByteString] -> Maybe (Either String (Int, B.ByteString), [BL.ByteString])
parse (c:sq:rest) =
    Just (Right (read $ BL.unpack c, B.concat $ BL.toChunks sq), rest)
parse [] = Nothing
parse fs = let showStanza = unlines (map BL.unpack fs)
               err = Left $ "Resample: illegal number of lines: " ++ showStanza
           in Just (err, [])

uncollapse :: (Int, B.ByteString) -> [B.ByteString]
uncollapse (c, sq) = take c $ repeat sq

randomPick' mt vec len = liftM (vec V.!) $ liftM ((flip mod) len) (random mt)

main :: IO ()
main = do
    sqvec <- liftM (V.fromList . Prelude.concatMap uncollapse) $ readCollapsed "/dev/stdin"
    let seqlen = V.length sqvec
    mtgen <- newMTGen Nothing
    replicateM_ 30000000 $ BC.putStrLn =<< randomPick' mtgen sqvec seqlen

Change History (5)

comment:1 Changed 18 months ago by simonmar

  • Difficulty set to Unknown
  • Milestone set to 7.6.2
  • Priority changed from normal to highest
  • Type of failure changed from None/Unknown to Runtime crash

Thanks for the report, we'll take a look.

comment:2 Changed 18 months ago by simonpj

  • Owner set to simonmar

comment:3 Changed 18 months ago by simonmar

Can you tell me how to reproduce this?

I presume the module name should be Main, not Resample. What input does the program need?

comment:4 Changed 17 months ago by simonmar

  • Status changed from new to infoneeded

comment:5 Changed 16 months ago by igloo

  • Resolution set to invalid
  • Status changed from infoneeded to closed

No response from submitter, so closing

Note: See TracTickets for help on using tickets.