Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Coredump while call perf2bolt in arm 4.14 #273

Open
dafoerx opened this issue Jan 4, 2022 · 5 comments
Open

Coredump while call perf2bolt in arm 4.14 #273

dafoerx opened this issue Jan 4, 2022 · 5 comments

Comments

@dafoerx
Copy link

dafoerx commented Jan 4, 2022

uname -a
4.14.0-115.el7a.0.1.aarch64 #1 SMP Sun Nov 25 20:54:21 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux

I am optimizing bin/postgres in the reference documentation, and core appears in the phase of converting perf.data in the ARM environment. Can anyone help

ref:
https://github.com/facebookincubator/BOLT

[root@01 bolt]# perf2bolt -p perf.data -o perf.fdata postgres -nl
PERF2BOLT: Starting data aggregation job for perf.data
PERF2BOLT: spawning perf job to read events without LBR
PERF2BOLT: spawning perf job to read mem events
PERF2BOLT: spawning perf job to read process events
PERF2BOLT: spawning perf job to read task events
BOLT-INFO: Target architecture: aarch64
BOLT-INFO: BOLT version: fe64c4001e17a994c178d1102d7cb12eee196a1c
BOLT-INFO: first alloc address is 0x400000
BOLT-INFO: creating new program header table at address 0x1000000, offset 0xc00000
BOLT-WARNING: non-relocation mode for AArch64 is not fully supported
BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
BOLT-INFO: pre-processing profile using perf data aggregator
BOLT-INFO: binary build-id is:     c07aa22e408b00530c7a0999e4e8f375ed75fd44
PERF2BOLT: spawning perf job to read buildid list
PERF2BOLT: matched build-id and file name
PERF2BOLT: waiting for perf mmap events collection to finish...
PERF2BOLT: parsing perf-script mmap events output
PERF2BOLT: waiting for perf task events collection to finish...
PERF2BOLT: parsing perf-script task events output
PERF2BOLT: input binary is associated with 884 PID(s)
PERF2BOLT: waiting for perf events collection to finish...
PERF2BOLT: parsing basic events (without LBR)...
perf2bolt: /root/test/tools/BOLT/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp:598: bool {anonymous}::AArch64MCPlusBuilder::analyzeIndirectBranchFragment(const llvm::MCInst&, llvm::DenseMap<const llvm::MCInst*, llvm::SmallVector<llvm::MCInst*, 4> >&, const llvm::MCExpr*&, int64_t&, int64_t&, llvm::MCInst*&) const: Assertion `DefJTBaseAdd->getOpcode() == AArch64::ADDXri && "Failed to match jump table base address pattern! (1)"' failed.
 #0 0x0000000000c90eec PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x0000000000c8f0dc SignalHandler(int) Signals.cpp:0:0
 #2 0x0000ffff81c2066c  0x66c raise
 #3 0x0000ffff81c2066c 
 #4 0x0000ffff81c2066c abort (+0x66c)
 #5 0x0000ffff816850e8 __assert_fail_base (/lib64/libc.so.6+0x350e8)
 #6 0x0000ffff81686760 __assert_perror_fail (/lib64/libc.so.6+0x36760)
 #7 0x0000ffff8167e5dc (anonymous namespace)::AArch64MCPlusBuilder::analyzeIndirectBranch(llvm::MCInst&, llvm::bolt::MCPlusBuilder::InstructionIterator, llvm::bolt::MCPlusBuilder::InstructionIterator, unsigned int, llvm::MCInst*&, unsigned int&, unsigned int&, long&, llvm::MCExpr const*&, llvm::MCInst*&) const AArch64MCPlusBuilder.cpp:0:0
 #8 0x0000ffff8167e694 llvm::bolt::BinaryFunction::processIndirectBranch(llvm::MCInst&, unsigned int, unsigned long, unsigned long&) (/lib64/libc.so.6+0x2e694)
 #9 0x0000000000dc6e18 llvm::bolt::BinaryFunction::disassemble() (/root/test/tools/BOLT/build/bin/llvm-bolt+0xdc6e18)
#10 0x00000000019b4364 llvm::bolt::RewriteInstance::disassembleFunctions() (/root/test/tools/BOLT/build/bin/llvm-bolt+0x19b4364)
#11 0x00000000019c8164 llvm::bolt::RewriteInstance::run() (/root/test/tools/BOLT/build/bin/llvm-bolt+0x19c8164)
#12 0x0000000000a920a8 main (/root/test/tools/BOLT/build/bin/llvm-bolt+0xa920a8)
#13 0x0000000000ae0440 __libc_start_main (/root/test/tools/BOLT/build/bin/llvm-bolt+0xae0440)
#14 0x000000000042b620 _start (/root/test/tools/BOLT/build/bin/llvm-bolt+0x42b620)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
perf2bolt[0xc90eec]
perf2bolt[0xc8f0dc]
[0xffff81c2066c]
/lib64/libc.so.6(gsignal+0x4c)[0xffff816850e8]
/lib64/libc.so.6(abort+0x11c)[0xffff81686760]
/lib64/libc.so.6(+0x2e5dc)[0xffff8167e5dc]
/lib64/libc.so.6(__assert_perror_fail+0x0)[0xffff8167e694]
perf2bolt[0xdc6e18]
perf2bolt[0x19b4364]
perf2bolt[0x19c8164]
perf2bolt[0xa920a8]
perf2bolt[0xae0440]
perf2bolt[0x42b620]
/lib64/libc.so.6(__libc_start_main+0xf0)[0xffff816715d4]
perf2bolt[0x47d4d4]
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.      Program arguments: perf2bolt -p perf.data -o perf.fdata postgres -nl
Aborted (core dumped)

@maksfb
Copy link
Contributor

maksfb commented Jan 5, 2022

@yota9, any idea what is happening there?

@yota9
Copy link
Contributor

yota9 commented Jan 5, 2022

Hello @dafoerx. Could you please attach the binary and perf file so I will be able to check the binary? Thank you.

@dafoerx
Copy link
Author

dafoerx commented Jan 6, 2022

Sorry, the core file is too big to upload temporarily, I can provide some more detailed location information for the time being.

1>os version
uname -r
4.14.0-115.el7a.0.1.aarch64
cat /etc/redhat-release
CentOS Linux release 7.6.1810 (AltArch)
2>bolt code version
git clone https://github.com/facebookincubator/BOLT.git
git log
fe64c40
3>Repetition steps
perf record -C 0-47 -e cycles:u -a -o perf.data -- sleep 180
perf2bolt -p perf.data -o perf.fdata postgres -nl

The core file is generated in aARCH64mcplusBuilder.cpp:598. I wonder what scenarios assert comes in.
analyzeIndirectBranchFragment
assert(DefJTBaseAdd->getOpcode() == AArch64::ADDXri &&
"Failed to match jump table base address pattern! (1)");

there is a position in the process of use is not strictly according to the operation, I do not know whether it affects,
I modify command A(perf record -C 0-47 -e cycles:_u -j any,_u -a -o perf.data -- sleep 180) to command B(perf record -C 0-47 -e cycles:u -a -o perf.data -- sleep 180)
Because my environment doesn't seem to support the -j operation.like this
"Error:
cycles:u: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'"

@dafoerx
Copy link
Author

dafoerx commented Jan 6, 2022

Maybe I'm similar to this issue
Failed to match indirect branch when BOLT AArch64 binary #111

Is there a way around it so my experiment can go on?
perf2bolt -p perf.data -o perf.fdata postgres -nl .....

@yota9
Copy link
Contributor

yota9 commented Jan 6, 2022

Sorry, I don't need the core file, I need the executable at least (better with the perf file) to reproduce the problem and check its asm and to find the failure reason

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants