#3821: Trace.Hpc.Reflect.examineTix segfaults on 64bit
---------------------------------+------------------------------------------
    Reporter:  TristanAllwood    |       Owner:  a...@…         
        Type:  bug               |      Status:  new            
    Priority:  normal            |   Component:  Code Coverage  
     Version:  6.12.1            |    Keywords:                 
          Os:  Unknown/Multiple  |    Testcase:                 
Architecture:  x86_64 (amd64)    |     Failure:  None/Unknown   
---------------------------------+------------------------------------------
 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 - t...@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.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3821>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to