[LLVMdev] unexpectedly loop hanging

Alexandru Ionut Diaconescu alexandruionutdiaconescu at gmail.com
Thu May 30 05:21:39 PDT 2013


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> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130530/fa7e8ca4/attachment.html>


More information about the llvm-dev mailing list