#7033: stale .tix files can cause programs built with -fhpc to segfault
------------------------------+---------------------------------------------
 Reporter:  jwlato            |          Owner:  andy@…          
     Type:  bug               |         Status:  new             
 Priority:  normal            |      Component:  Code Coverage   
  Version:  7.4.2             |       Keywords:                  
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  Runtime crash     |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------
 In some circumstances, programs built with -fhpc will segfault when old
 .tix files reference modules that no longer exist.

 foo.hs
 {{{
 import Bar

 main = print "Hello World"
 }}}

 Bar.hs
 {{{
 module Bar where

 something = 1 :: Int
 }}}

 {{{
 jwlato@compy:~/explorations$ ghc -O -fhpc foo.hs
 [1 of 2] Compiling Bar              ( Bar.hs, Bar.o )
 [2 of 2] Compiling Main             ( foo.hs, foo.o )
 Linking foo ...
 jwlato@compy:~/explorations$ ./foo
 "Hello world"
 jwlato@compy:~/explorations$ mv Bar.hs Bar.hs.orig
 jwlato@compy:~/explorations$ sed -e 's/import/-- import/' -i.bak foo.hs
 jwlato@compy:~/explorations$ rm *.hi; rm *.o
 jwlato@compy:~/explorations$ ghc -O -fhpc foo.hs
 [1 of 1] Compiling Main             ( foo.hs, foo.o )
 Linking foo ...
 jwlato@compy:~/explorations$ ./foo
 Segmentation fault
 }}}

 If "foo.hs" has a 'module Main where' declaration, instead of a segfault
 the program exits with a message that 'foo.tix' should be deleted.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7033>
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