Opened 4 years ago

Closed 4 years ago

#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 Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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:

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 4 years ago by simonmar

difficulty: Unknown
Milestone: 7.6.2
Priority: normalhighest
Type of failure: None/UnknownRuntime crash

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

comment:2 Changed 4 years ago by simonpj

Owner: set to simonmar

comment:3 Changed 4 years 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 4 years ago by simonmar

Status: newinfoneeded

comment:5 Changed 4 years ago by igloo

Resolution: invalid
Status: infoneededclosed

No response from submitter, so closing

Note: See TracTickets for help on using tickets.