profiling crashes my code

Hal Daume III hdaume@ISI.EDU
Wed, 1 May 2002 12:38:37 -0700 (PDT)


I'm in a profiling kind of mood (read: am sick of my program taking too
long to run), but when I ghc with -prof -auto-all (or -auto or whatever),
when I try to run my program it seg faults.  I don't want to attach all
the code, since it's really long, but I *have* tested profiling on smaller
programs and it works fine.  (Note that the program crashes regardless of
whether I put +RTS -p or not.)

Here are some "unusual" things I'm doing; hopefully someone will be able
to say "oh, there's your problem":

 - using the ghc binary package (which using FastMutInt -- I don't really
   know what this does, but it looks scary)
 - i'm only compiling the main program with profiling -- it imports a
   whole lot of modules which are compiled with -O2, including binary
   which is compiled using -cpp also
 - i use the Word8 type extensively
 - i use unsafePerformIO (but only once per run of the code)
 - i use UArray Int Double  (i think this also uses upIO)
 - uhm...i do a lot of file io :)

That's all I can think of at the moment.  It dies regarless of whether I
use -O, -O2, or neither...

--
Hal Daume III

 "Computer science is no more about computers    | hdaume@isi.edu
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume