Debugging memory errors on linux...

This email isn't really LLVM specific, but is definately useful for LLVM
people so....

I've downloaded and installed "valgrind" (http://developer.kde.org/~sewardj/),
an open source "purify" replacement. It is actually quite a bit nicer
than purify is, as it doesn't require you to recompile or modify your
executables _at all_ to run them (it also seems quite fast).

Anyway, if you suspect you have memory error issues, I'd recommend trying
it out. It only works on x86 platforms though. On our research machines
you can use it from /home/vadve/lattner/local/x86/bin/valgrind. Just run
it like this:

valgrind dis < post-process.o
...
==6220== Conditional jump or move depends on uninitialised value(s)
==6220== at 0x805D883: (within /mounts/apoc/disks/0/localhome/lattner/cvs/llvm/tools/Debug/dis)
==6220== by 0x807EF26: Constant::mutateReferences(Value*, Value*) (Constants.cpp:700)
==6220== by 0x80544DA: BytecodeParser::ResolveReferencesToValue(Value*, unsigned) (Reader.cpp:265)
==6220== by 0x804F7A6: BytecodeParser::ParseConstantPool(unsigned char const*&, unsigned char const*, std::vector<std::vector<V

Which, in this case, brought me right to my error. :slight_smile:

-Chris

http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/