Skip to content

Loop::isLCSSAForm crashes #11772

@llvmbot

Description

@llvmbot
Bugzilla Link 11400
Resolution INVALID
Resolved on May 06, 2012 15:29
Version 2.9
OS Linux
Attachments a pass that causes the crash
Reporter LLVM Bugzilla Contributor
CC @atrick

Extended Description

Hi,

I got a segmentation fault when running the attached pass. I did compile LLVM with debug+asserts, but I didn't see any assertion failure before the crash.

dumped stack:
0 opt 0x0000000000d895c2
1 opt 0x0000000000d893be
2 libpthread.so.0 0x00007f4fa6aa7060
3 opt 0x0000000000b1ef44 void llvm::SmallPtrSet<llvm::BasicBlock*, 16u>::insert<__gnu_cxx::__normal_iterator<llvm::BasicBlock* const*, std::vector<llvm::BasicBlock*, std::allocatorllvm::BasicBlock* > > >(__gnu_cxx::__normal_iterator<llvm::BasicBlock* const*, std::vector<llvm::BasicBlock*, std::allocatorllvm::BasicBlock* > >, __gnu_cxx::__normal_iterator<llvm::BasicBlock* const*, std::vector<llvm::BasicBlock*, std::allocatorllvm::BasicBlock* > >) + 34
4 opt 0x0000000000b1e80b llvm::SmallPtrSet<llvm::BasicBlock*, 16u>::SmallPtrSet<__gnu_cxx::__normal_iterator<llvm::BasicBlock* const*, std::vector<llvm::BasicBlock*, std::allocatorllvm::BasicBlock* > > >(__gnu_cxx::__normal_iterator<llvm::BasicBlock* const*, std::vector<llvm::BasicBlock*, std::allocatorllvm::BasicBlock* > >, __gnu_cxx::__normal_iterator<llvm::BasicBlock* const*, std::vector<llvm::BasicBlock*, std::allocatorllvm::BasicBlock* > >) + 71
5 opt 0x0000000000b1d879 llvm::Loop::isLCSSAForm(llvm::DominatorTree&) const + 83
6 misc.so 0x00007f4fa5b4f2d7 slicer::IdentifyLoops::process(llvm::Loop*, llvm::Function*) + 71
7 misc.so 0x00007f4fa5b4f3d3 slicer::IdentifyLoops::runOnModule(llvm::Module&) + 211
8 opt 0x0000000000d0aa40 llvm::MPPassManager::runOnModule(llvm::Module&) + 456
9 opt 0x0000000000d0af37 llvm::PassManagerImpl::run(llvm::Module&) + 125
10 opt 0x0000000000d0b33f llvm::PassManager::run(llvm::Module&) + 39
11 opt 0x00000000008c242a main + 4339
12 libc.so.6 0x00007f4fa5d7430d __libc_start_main + 237
13 opt 0x00000000008b3089
Stack dump:
0. Program arguments: opt -load /home/jingyue/Research/llvm/install/lib/misc.so -identify-loops -disable-output

  1.  Running pass 'Identify loops' on module '<stdin>'.
    

Segmentation fault

Attaching GDB shows more detailed info:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000b1ef44 in llvm::SmallPtrSet<llvm::BasicBlock*, 16u>::insert<__gnu_cxx::__normal_iterator<llvm::BasicBlock* const*, std::vector<llvm::BasicBlock*, std::allocatorllvm::BasicBlock* > > > (this=0x7fffffffd570, I=..., E=...)
at /home/jingyue/Research/llvm/llvm-2.9/include/llvm/ADT/SmallPtrSet.h:270
270 insert(I);
(gdb) bt
#​0 0x0000000000b1ef44 in llvm::SmallPtrSet<llvm::BasicBlock
, 16u>::insert<__gnu_cxx::__normal_iterator<llvm::BasicBlock* const*, std::vector<llvm::BasicBlock*, std::allocatorllvm::BasicBlock* > > > (this=0x7fffffffd570, I=..., E=...)
at /home/jingyue/Research/llvm/llvm-2.9/include/llvm/ADT/SmallPtrSet.h:270
#​1 0x0000000000b1e80b in llvm::SmallPtrSet<llvm::BasicBlock*, 16u>::SmallPtrSet<__gnu_cxx::__normal_iterator<llvm::BasicBlock* const*, std::vector<llvm::BasicBlock*, std::allocatorllvm::BasicBlock* > > > (this=0x7fffffffd570, I=..., E=...)
at /home/jingyue/Research/llvm/llvm-2.9/include/llvm/ADT/SmallPtrSet.h:247
#​2 0x0000000000b1d879 in llvm::Loop::isLCSSAForm (this=0x13492c0, DT=...)
at LoopInfo.cpp:261
#​3 0x00007ffff6c772d7 in slicer::IdentifyLoops::process (this=0x134fa10,
l=0x13492c0, f=0x133c660) at identify-loops.cpp:42
#​4 0x00007ffff6c773d3 in slicer::IdentifyLoops::runOnModule (this=0x134fa10, M=...)
at identify-loops.cpp:52
#​5 0x0000000000d0aa40 in llvm::MPPassManager::runOnModule (this=0x1337630, M=...)
at PassManager.cpp:1557
#​6 0x0000000000d0af37 in llvm::PassManagerImpl::run (this=0x13403b0, M=...)
at PassManager.cpp:1640
#​7 0x0000000000d0b33f in llvm::PassManager::run (this=0x7fffffffd930, M=...)
at PassManager.cpp:1684
#​8 0x00000000008c242a in main (argc=5, argv=0x7fffffffdb38) at opt.cpp:689

What's more interesting is that the pass runs fine if I remove Line 41 (in Function process):
DT = &getAnalysis(*f);

I tried diagnosing this issue more, but didn't get anything more useful due to my superficial knowledge on LLVM. It would be great if you could take a look. Thanks much.

Best,

Jingyue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillainvalidResolved as invalid, i.e. not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions