[LLVMdev] unexpectedly loop hanging

Duncan Sands baldrick at free.fr
Thu May 30 06:05:35 PDT 2013


Hi Alexandru, if these are LLVM Makefiles, then I suggest you configure and
build LLVM with the options:

   --disable-optimized --enable-assertions

This will make debugging much easier.  It enables debug info too, which you can
also turn on directly by configuring with --enable-debug-symbols.

Ciao, Duncan.

On 30/05/13 14:21, Alexandru Ionut Diaconescu wrote:
> Hello Duncan,
>
> Thank you for your quick answer. I use the standard Makefile from a pass, that
> is calling Makefile.common. I saw only the make -d option, that "*/print lots of
> debugging information/*", as mentioned by LLVM.
>
> Using this, valgrind don't tell me extra info. It is a very good idea ti use -g,
> but where to insert? If I am trying to use clang++, I have to fix a lot of
> things. Should I make the changes for to use clang++ or I can debug using the
> Makefile.common?
>
>
> On Thu, May 30, 2013 at 1:57 PM, Duncan Sands <baldrick at free.fr
> <mailto:baldrick at free.fr>> wrote:
>
>     Hi Alexandru,
>
>      > /*==5134== Invalid write of size 4
>
>         ==5134==    at 0x4039280: (anonymous
>         namespace)::Hello::__runOnModule(llvm::Module&) (in
>         /home/alex/llvm/Release+__Asserts/lib/Hello.so)
>         ==5134==    by 0x8E33DE3:
>         llvm::MPPassManager::__runOnModule(llvm::Module&) (in
>         /home/alex/llvm/Release+__Asserts/bin/opt)
>         ==5134==    by 0x8E3726F: llvm::PassManagerImpl::run(__llvm::Module&) (in
>         /home/alex/llvm/Release+__Asserts/bin/opt)
>         ==5134==    by 0x8E37385: llvm::PassManager::run(llvm::__Module&) (in
>         /home/alex/llvm/Release+__Asserts/bin/opt)
>         ==5134==    by 0x41AE4D2: (below main) (libc-start.c:226)
>         ==5134==  Address 0x46cfa40 is 0 bytes after a block of size 200 alloc'd
>         ==5134==    at 0x402C454: operator new[](unsigned int) (in
>         /usr/lib/valgrind/vgpreload___memcheck-x86-linux.so)
>         ==5134==    by 0x4037AE0: (anonymous
>         namespace)::Hello::__runOnModule(llvm::Module&) (in
>         /home/alex/llvm/Release+__Asserts/lib/Hello.so)*/
>
>         ==5134==  Address 0x46cfa40 is 0 bytes after a block of size 200 alloc'd
>         ==5134==    at 0x402C454: operator new[](unsigned int) (in
>         /usr/lib/valgrind/vgpreload___memcheck-x86-linux.so)
>         ==5134==    by 0x4037AE0: (anonymous
>         namespace)::Hello::__runOnModule(llvm::Module&) (in
>         /home/alex/llvm/Release+__Asserts/lib/Hello.so)
>
>
>     you are writing of the end of an array that you allocated with "new".  If you
>     compile your program with debug info (-g) then valgrind should give you the line
>     number at which the allocation occurred and the line number at which the bad
>     write occurred.
>
>     Ciao, Duncan.
>
>
>
>
> --
> Best regards,
> Alexandru Ionut Diaconescu




More information about the llvm-dev mailing list