[LLVMdev] problem with llvm pass for call graph & CFG

John Criswell criswell at illinois.edu
Tue Mar 6 07:33:42 PST 2012


On 3/6/12 8:42 AM, Buse Yilmaz wrote:
> Hi all,
> I wrote a pass (attached). But I get a runtime error:

It looks like you're using a Release build of LLVM.  I recommend 
compiling LLVM and your pass in a Debug build; that will generate 
asserts and provide source line information so that you can more easily 
debug the problem.

I don't have time to look at your code in detail (and chances are good 
that nobody else on the list does, either), but if I had to guess, 
you're probably assuming that a value is always non-NULL when it can be 
NULL.  I'd double check that F and other critical values are non-NULL by 
adding assert statements.

-- John T.

>
> buse at buse-VB:~/Desktop/llvm-2.7/lib/Transforms/CG_CFG$ opt-2.7 -load 
> ../../../Release/lib/_CG_CFGGen.so -CG_CFGGen < 
> ../../../buse/simpleCode.bc > /dev/null
> 0xa7bae0:
> 0  libLLVM-2.7.so.1 0x00007f4a8b6add1f
> 1  libLLVM-2.7.so.1 0x00007f4a8b6ae36d
> 2  libpthread.so.0  0x00007f4a8aa98b40
> 3  _CG_CFGGen.so    0x00007f4a8995891f
> 4  libLLVM-2.7.so.1 0x00007f4a8b329608 
> llvm::MPPassManager::runOnModule(llvm::Module&) + 376
> 5  libLLVM-2.7.so.1 0x00007f4a8b32972b 
> llvm::PassManagerImpl::run(llvm::Module&) + 107
> 6  opt-2.7          0x0000000000415df3 main + 2035
> 7  libc.so.6        0x00007f4a89b79d8e __libc_start_main + 254
> 8  opt-2.7          0x0000000000409569
> Stack dump:
> 0.    Program arguments: opt-2.7 -load 
> ../../../Release/lib/_CG_CFGGen.so -CG_CFGGen
> 1.    Running pass 'Unnamed pass: implement Pass::getPassName()' on 
> module '<stdin>'.
> Segmentation fault
> buse at buse-VB:~/Desktop/llvm-2.7/lib/Transforms/CG_CFG$
>
> I couldn't diagnose the problem. Any ideas?
> -- 
> Buse
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120306/2190d6d6/attachment.html>


More information about the llvm-dev mailing list