Skip to content

Trace.Hpc.Reflect.examineTix segfaults on 64bit

The following seg-faults on my 64bit ghc 6.12.1 when compiled with -fhpc

module Main where

import B
import Trace.Hpc.Reflect

main :: IO ()
main = do
  examineTix
  print (foo 3)
  return ()
module B where

foo 0 = 0
foo n = 1 + foo (n-1)
>ghc --make -fforce-recomp -fhpc Main
[1 of 2] Compiling B                ( B.hs, B.o )
[2 of 2] Compiling Main             ( Main.hs, Main.o )
Linking Main ...

10:21:55 - tora@colorado:/tmp/HPC
>./Main 
Segmentation fault

I believe the cause is that data ModuleInfo = ModuleInfo String Int Hash (Ptr Word64) in Trace.Hpc.Reflect uses a variable sized Int instead of a fixed (32bit if I'm reading the sources correctly) Word32 for the count.

I've attached a patch that should fix the issue.

Trac metadata
Trac field Value
Version 6.12.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Code Coverage
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