hpc bug lurking?
tora at zonetora.co.uk
Thu Jan 14 13:00:36 EST 2010
data ModuleInfo = ModuleInfo String Int Hash (Ptr Word64)
in Trace.HPC.Reflect should be
data ModuleInfo = ModuleInfo String *Int32* Hash (Ptr Word64)
Currently Trace.HPC.Reflect uses a peekByteOff to read that Int which
appears to be able to get corrupted by junk values if used in
combination with some hacks and the GHC API and a non-32bit Int size
Can anyone confirm that this is a potential bug lurking, or whether it
really should be ok and I've probably done something v.bad elsewhere?
I'm currently doing some very unsafe things with hpc and the ghc
(6.12.1) api (like calling hs_hpc_module manually to late-register
object files which I've dyanmically loaded using loadObj) as part of a
black-box-expression test generator. This actually all worked fine and
.mix/.tix files etc would be generated correctly on program shutdown
Anyways, I started trying to use Trace.HPC.Reflect and would get instant
seg-faults. A bit of debugging through my own clone of
Trace.HPC.Reflect has led me to suspect the above cause.
More information about the Cvs-ghc