[LLVMbugs] [Bug 6981] New: JIT crashes on code containing debug info

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 29 16:40:00 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=6981

           Summary: JIT crashes on code containing debug info
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: dpatel at apple.com
        ReportedBy: jyasskin at google.com
                CC: llvmbugs at cs.uiuc.edu


1 crash seems to be about leaving debug intrinsics in code for too long

$ cat test.c
int main(void) {
  int i =3;
}
$ Debug/bin/clang -g test.c -emit-llvm -c -o test.bc

$ Debug/bin/lli test.bc
psuedo instructions should be removed before code emission
UNREACHABLE executed at
/Users/jyasskin/src/llvm/clang/src/lib/Target/X86/X86CodeEmitter.cpp:609!
0  libLLVM-2.8svn.dylib 0xe08fcee4 llvm::SearchForAddressOfSpecialSymbol(char
const*) + 478
1  libLLVM-2.8svn.dylib 0xe08fd32a llvm::sys::SetInterruptFunction(void (*)())
+ 436
2  libSystem.B.dylib    0x9065e2bb _sigtramp + 43
3  libSystem.B.dylib    0xffffffff _sigtramp + 1872371055
4  libSystem.B.dylib    0x906d223a raise + 26
5  libSystem.B.dylib    0x906de679 abort + 73
6  libLLVM-2.8svn.dylib 0xe08d0563 llvm::llvm_unreachable_internal(char const*,
char const*, unsigned int) + 201
7  libLLVM-2.8svn.dylib 0xe09964d8 (anonymous
namespace)::Emitter<llvm::JITCodeEmitter>::emitInstruction(llvm::MachineInstr
const&, llvm::TargetInstrDesc const*) + 1772
8  libLLVM-2.8svn.dylib 0xe09979f0 (anonymous
namespace)::Emitter<llvm::JITCodeEmitter>::runOnMachineFunction(llvm::MachineFunction&)
+ 576
9  libLLVM-2.8svn.dylib 0xe034e609
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 77
10 libLLVM-2.8svn.dylib 0xe0500ce9
llvm::FPPassManager::runOnFunction(llvm::Function&) + 287
11 libLLVM-2.8svn.dylib 0xe0500f0a
llvm::FunctionPassManagerImpl::run(llvm::Function&) + 80
12 libLLVM-2.8svn.dylib 0xe050105f
llvm::FunctionPassManager::run(llvm::Function&) + 195
13 libLLVM-2.8svn.dylib 0xe05cbf63
llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard const&) +
123
14 libLLVM-2.8svn.dylib 0xe05cc2f6
llvm::JIT::getPointerToFunction(llvm::Function*) + 622
15 libLLVM-2.8svn.dylib 0xe05cd1c9 llvm::JIT::runFunction(llvm::Function*,
std::vector<llvm::GenericValue, std::allocator<llvm::GenericValue> > const&) +
99
16 libLLVM-2.8svn.dylib 0xe054e147
llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*,
std::vector<std::string, std::allocator<std::string> > const&, char const*
const*) + 1135
17 lli                  0x00002c7d main + 2313
18 lli                  0x00002306 start + 54
Stack dump:
0.    Program arguments: Debug/bin/lli test.bc 
1.    Running pass 'X86 Machine Code Emitter' on function '@main'
Abort trap


The other seems to be about metadata that isn't materialized from bitcode soon
enough:

$ cat test2.c
int fib_left(int);
int fib_right(int);

int fib_left(int i) {
  if (i < 2)
    return 1;
  return fib_left(i-1) + fib_right(i-2);
}
int fib_right(int i) {
  if (i < 2)
    return 1;
  return fib_left(i-1) + fib_right(i-2);
}
int fib(int i) {
  if (i < 2)
    return 1;
  return fib_left(i-1) + fib_right(i-2);
}

int main() {
  int i = 40;
  fib(i);
}
$ Debug/bin/clang -g test2.c -emit-llvm -c -o test2.bc
$ Debug/bin/lli test2.bc
Assertion failed: (isa<X>(Val) && "cast_or_null<Ty>() argument of incompatible
type!"), function cast_or_null, file
/Users/jyasskin/src/llvm/clang/src/include/llvm/Support/Casting.h, line 213.
0  libLLVM-2.8svn.dylib 0xe08fcee4 llvm::SearchForAddressOfSpecialSymbol(char
const*) + 478
1  libLLVM-2.8svn.dylib 0xe08fd32a llvm::sys::SetInterruptFunction(void (*)())
+ 436
2  libSystem.B.dylib    0x9065e2bb _sigtramp + 43
3  libSystem.B.dylib    0xffffffff _sigtramp + 1872371055
4  libSystem.B.dylib    0x906d223a raise + 26
5  libSystem.B.dylib    0x906de679 abort + 73
6  libSystem.B.dylib    0x906d33db __assert_rtn + 101
7  libLLVM-2.8svn.dylib 0xe048eec7 llvm::cast_retty<llvm::MDNode,
llvm::Value*>::ret_type llvm::cast_or_null<llvm::MDNode,
llvm::Value>(llvm::Value*) + 107
8  libLLVM-2.8svn.dylib 0xe04de085 llvm::DbgDeclareInst::getAddress() const +
33
9  libLLVM-2.8svn.dylib 0xe083f31f
llvm::SelectionDAGBuilder::visitIntrinsicCall(llvm::CallInst const&, unsigned
int) + 4805
10 libLLVM-2.8svn.dylib 0xe0842967
llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 231
11 libLLVM-2.8svn.dylib 0xe0843c3e llvm::SelectionDAGBuilder::visit(unsigned
int, llvm::User const&) + 1328
12 libLLVM-2.8svn.dylib 0xe085ca1b
llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 111
13 libLLVM-2.8svn.dylib 0xe08749ed
llvm::SelectionDAGISel::SelectBasicBlock(llvm::MachineBasicBlock*,
llvm::BasicBlock const*, llvm::ilist_iterator<llvm::Instruction const>,
llvm::ilist_iterator<llvm::Instruction const>, bool&) + 45
14 libLLVM-2.8svn.dylib 0xe0875082
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 1510
15 libLLVM-2.8svn.dylib 0xe087538e
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 668
16 libLLVM-2.8svn.dylib 0xe034e609
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 77
17 libLLVM-2.8svn.dylib 0xe0500ce9
llvm::FPPassManager::runOnFunction(llvm::Function&) + 287
18 libLLVM-2.8svn.dylib 0xe0500f0a
llvm::FunctionPassManagerImpl::run(llvm::Function&) + 80
19 libLLVM-2.8svn.dylib 0xe050105f
llvm::FunctionPassManager::run(llvm::Function&) + 195
20 libLLVM-2.8svn.dylib 0xe05cbf63
llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard const&) +
123
21 libLLVM-2.8svn.dylib 0xe05cc2f6
llvm::JIT::getPointerToFunction(llvm::Function*) + 622
22 libLLVM-2.8svn.dylib 0xe05cd1c9 llvm::JIT::runFunction(llvm::Function*,
std::vector<llvm::GenericValue, std::allocator<llvm::GenericValue> > const&) +
99
23 libLLVM-2.8svn.dylib 0xe054e147
llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*,
std::vector<std::string, std::allocator<std::string> > const&, char const*
const*) + 1135
24 lli                  0x00002c7d main + 2313
25 lli                  0x00002306 start + 54
Stack dump:
0.    Program arguments: Debug/bin/lli test2.bc 
1.    Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'
Abort trap


We seem to need more tests for this.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list