Skip to content

+RTS -hT does not report about SmallArray objects

+RTS -hT seems to ignore SmallArray# objects. Also the combination of SmallArray# objects and -hT causes a segfault on ghc 7.10.

To reproduce, save the following progam as smallarray.hs

{-# LANGUAGE MagicHash #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE UnboxedTuples #-}
import GHC.Exts
import GHC.IO (IO(..), unIO)
import Control.Concurrent
import Control.Monad
import System.Mem

main :: IO ()
main = do
  forkIO $ forever $ performGC
  IO $ \s0 ->
    let
      !(# s01, msa #) = newSmallArray# 100# 'X' s0
      !s02 = writeSmallArray# msa 4# 'Y' s01
      !(# s1, sa #) = unsafeFreezeSmallArray# msa s02
      !(# s2, () #) = unIO (threadDelay 5000000) s1
      !(# v #) = indexSmallArray# sa 2#
      !(# s3, () #) = unIO (print v) s2
    in (# s3, () #)

compile it, and run it like:

ghc smallarray.hs -rtsopts -threaded
./samllarray +RTS -hT
Trac metadata
Trac field Value
Version 8.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information