Issue 131790
Summary Bolt instrumentation failing: Assertion `!StateStack.empty() && "corrupt CFI stack"' failed
Labels BOLT
Assignees
Reporter WangJee
    Bolt instrumentation is failing when trying to instrument mysqld when target is RISCV

-  Bolt is the extreme version of 19.x, and I have implemented the instrumentation for target RISCV.
- it works fine when i build mysqld with gcc,but it fails when i use llvm
- llvm-bolt --instrumentation-file-append-pid --instrumentation-file=/home/compiler-test/perf/mysqld --instrument ./mysqld -o mysqld.inst

BOLT-INFO: shared object or position-independent executable detected
BOLT-INFO: Target architecture: riscv64 

BOLT-INFO: BOLT version: 158768b4afc878a530a50bac034fc81ad1e5a0ee
BOLT-INFO: first alloc address is 0x0
BOLT-INFO: creating new program header table at address 0x5000000, offset 0x5000000
BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it.
BOLT-INFO: enabling relocation mode
BOLT-INFO: forcing -jump-tables=move for instrumentation

llvm-bolt: /root/script/riscv_dev/llvm-bolt/bolt/lib/Core/BinaryFunction.cpp:2505: void llvm::bolt::BinaryFunction::annotateCFIState(): Assertion `StateStack.empty() && "corrupt CFI stack"' failed.

 #0 0x0000556f0bbbd23e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /root/script/riscv_dev/llvm-bolt/llvm/lib/Support/Unix/Signals.inc:723:22
 #1 0x0000556f0bbbd65f PrintStackTraceSignalHandler(void*) /root/script/riscv_dev/llvm-bolt/llvm/lib/Support/Unix/Signals.inc:798:1
 #2 0x0000556f0bbbaaaf llvm::sys::RunSignalHandlers() /root/script/riscv_dev/llvm-bolt/llvm/lib/Support/Signals.cpp:105:20
 #3 0x0000556f0bbbcad6 SignalHandler(int) /root/script/riscv_dev/llvm-bolt/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x00007f0ad187a520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #5 0x00007f0ad18ce9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #6 0x00007f0ad187a476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #7 0x00007f0ad18607f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #8 0x00007f0ad186071b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #9 0x00007f0ad1871e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#10 0x0000556f0d433712 llvm::bolt::BinaryFunction::annotateCFIState() /root/script/riscv_dev/llvm-bolt/bolt/lib/Core/BinaryFunction.cpp:2506:1
#11 0x0000556f0d432510 llvm::bolt::BinaryFunction::buildCFG(unsigned short) /root/script/riscv_dev/llvm-bolt/bolt/lib/Core/BinaryFunction.cpp:2269:27
#12 0x0000556f0bd087b3 llvm::bolt::RewriteInstance::buildFunctionsCFG()::'lambda'(llvm::bolt::BinaryFunction&, unsigned short)::operator()(llvm::bolt::BinaryFunction&, unsigned short) const /root/script/riscv_dev/llvm-bolt/bolt/lib/Rewrite/RewriteInstance.cpp:3364:24

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to