
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

Hal Daume III
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.)
Okay, I've only just toyed with profiling myself, but one observation I've made is that it's not a good idea to mix modules compiled with profiling and modules compiled without. That is, always 'make clean' (i.e. 'rm -f *.o *.hi') before you build with a new set of options. -kzm -- If I haven't seen further, it is by standing in the footprints of giants

Hal Daume wrote:
I'm in a profiling kind of mood [...] [...] it seg faults.
Here are some "unusual" things I'm doing; hopefully someone will be able to say "oh, there's your problem":
- i'm only compiling the main program with profiling
"Oh, there's your problem" Ketil Z. Malde wrote:
I've made is that it's not a good idea to mix modules compiled with profiling and modules compiled without.
Exactly. It's a really bad idea, as the run-time system uses different (read: incompatible) data structures for profiling. It's just a coincidence that some simple programs seem to run sometimes... Cheers, Wolfgang Thaller
participants (3)
-
Hal Daume III
-
ketil@ii.uib.no
-
Wolfgang Thaller