
#13857: compactAdd doesn't work with SmallArray# -------------------------------------+------------------------------------- Reporter: andrewthad | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Runtime System | Version: 8.2.1-rc2 Resolution: | Keywords: compact Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3888 Wiki Page: | -------------------------------------+------------------------------------- Changes (by andrewthad): * status: closed => new * resolution: fixed => Comment: This still doesn't work correctly as noted by rfbacon on a reddit thread: https://www.reddit.com/r/haskell/comments/8juajl/attempt_to_compact_hashmap_... Consider the following example: {{{ import GHC.Compact import Data.Primitive.SmallArray import Control.Monad.ST (runST) main :: IO () main = do _ <- compact (runST (newSmallArray 12 (55 :: Integer) >>= unsafeFreezeSmallArray)) putStrLn "done" }}} This causes the program to crash at runtime with an out of memory error. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13857#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler