[GHC] #13857: compactAdd doesn't work with SmallArray#

GHC ghc-devs at haskell.org
Wed May 16 14:25:40 UTC 2018


#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_results_in_a_crash/

 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


More information about the ghc-tickets mailing list