[LLVMdev] LLVM Pass Crashes

Duncan Sands baldrick at free.fr
Fri Jan 4 09:09:51 PST 2013

Hi Ahmad,

 > I am writing an LLVM pass that compiles fine and opt instrumentation goes fine
> as well. But when I run the instrumented C-program then I get the following
> stack dump. My question is, how can I debug the problem in this scenario please?
> // LLVM pass compiles fine and the following OPT instrumentation goes fine for
> basic malloc.bc program as well. Malloc.bc runs fine without any instrumentation.
> opt -o a.bc -load /data/ahmad/llvm3.1/Release+Asserts/lib/mypass.so  -MyPass <
> malloc.bc
> $ lli a.bc
> *** buffer overflow detected ***: lli terminated

this looks like a bug in your IR.  I suggest you compile and link to a normal
program using llc + assembler + linker, rather than running under lli, and debug
in the classical way, eg using valgrind.  You can also run lli in a debugger, or
under valgrind.

Ciao, Duncan.

More information about the llvm-dev mailing list