harvard-acc / LLVM-Tracer

An LLVM pass to profile dynamic LLVM IR instructions and runtime values
Other
135 stars 35 forks source link

void Tracer::handleInstructionResult(llvm::Instruction*, llvm::Instruction*, InstEnv*): Assertion `false && "Return instruction is terminator...\n"' failed. #41

Closed liaomin111 closed 3 years ago

liaomin111 commented 3 years ago

Hello, could you help me with this issue?When I was generating opt.llvm, I met a mistake. Here are the commands I used and the error log. root@5b6be5e4a8ba:/workspace/LLVM-Tracer/work# make clang -g -O1 -S -static -emit-llvm -o main.llvm main.cpp opt -S -load=/workspace/LLVM-Tracer/lib/full_trace.so -fulltrace main.llvm -o main-opt.llvm opt: /workspace/LLVM-Tracer/full-trace/full_trace.cpp:939: void Tracer::handleInstructionResult(llvm::Instruction, llvm::Instruction, InstEnv): Assertion `false && "Return instruction is terminator...\n"' failed. 0 opt 0x00000000018519d8 llvm::sys::PrintStackTrace(_IO_FILE) + 53 1 opt 0x0000000001851c68 2 opt 0x0000000001851631 3 libpthread.so.0 0x00007efd87f1b390 4 libc.so.6 0x00007efd872d4428 gsignal + 56 5 libc.so.6 0x00007efd872d602a abort + 362 6 libc.so.6 0x00007efd872ccbd7 7 libc.so.6 0x00007efd872ccc82 8 full_trace.so 0x00007efd870945b7 9 full_trace.so 0x00007efd870949e1 Tracer::runOnBasicBlock(llvm::BasicBlock&) + 1057 10 full_trace.so 0x00007efd87092cf0 Tracer::runOnFunction(llvm::Function&) + 208 11 opt 0x0000000001716004 llvm::FPPassManager::runOnFunction(llvm::Function&) + 330 12 opt 0x000000000171617a llvm::FPPassManager::runOnModule(llvm::Module&) + 120 13 opt 0x000000000171647a 14 opt 0x0000000001716972 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 262 15 opt 0x0000000001716b4b llvm::legacy::PassManager::run(llvm::Module&) + 39 16 opt 0x00000000008d2bc8 main + 5804 17 libc.so.6 0x00007efd872bf830 __libc_start_main + 240 18 opt 0x00000000008c4299 _start + 41 Stack dump:

  1. Program arguments: opt -S -load=/workspace/LLVM-Tracer/lib/full_trace.so -fulltrace main.llvm -o main-opt.llvm
  2. Running pass 'Function Pass Manager' on module 'main.llvm'.
  3. Running pass 'Add full Tracing Instrumentation for Aladdin' on function '@ main' Makefile:34: recipe for target 'main-opt.llvm' failed make: *** [main-opt.llvm] Aborted (core dumped)
xyzsam commented 3 years ago

Can you share a minimal test case from your code so I can try to reproduce this?