Open HShan886 opened 2 years ago
Hi @Haishan312, Can you please add a BOLT log? What is the compiler the program has been compiled with? I remember seeing this function as split in gcc libstdc++.
@aaupov thank you for replying
my program was compiled with gcc-4.9.2. and here is bolt.log bolt.log
@Haishan312,
Thanks for the log. Cold fragments are out of question. @maksfb, @rafaelauler: any suggestions on how to track down/workaround possible LSDA corruption?
The toolchain (gcc-4.9.2) is quite old. Upgrading it should probably solve this. But I'm curious on why BOLT is messing up eh_frame. I would start by running BOLT without any optimization flags, without profile, -relocs=1 -lite=0, just to check that the program fails even when no code is changed. If it does not, then I would start to zero-in which function is causing the problem after being optimized and which optimization is causing problems. If it does, then I would run a debugger to print which function is throwing, get its name and run -print-only=funcname -print-finalized to dump how BOLT is reading this function, paying particular attention to CFIs. If CFIs are being ingested, are they correct?
@rafaelauler thank you firstly.
my program run ok, when I add external -lite=0
into recommended optimization options, like:
llvm-bolt test -o test.elf -data=perf.fdata -reorder-blocks=cache+ -reorder-functions=hfsort -split-functions=2 -split-all-cold -split-eh -dyno-stats -lite=0 -v=2
Would the -lite=0
reduce the performance?
Hi @Haishan312, you're very welcome, thanks for reporting. -lite=0 will actually cause BOLT to take more time and memory to optimize the program because it is rewriting the entire program instead of just the important functions. If -lite=1 produces a faulty program but -lite=0 does not, then this is a lite mode bug. I'm interested in investigating this, let me know if you can reproduce this bug in a binary that you can share.
@rafaelauler this binary is very large. I cannot upload the binary, Sorry. Could you share your suggestion for fix-up this bug?
When using latest bolt, my program received signal SIGSEGV when throwing an exception. And I upgrade to binutils-2.32, it stills crash.
Here is backtrace:
Compare original program with bolted program, encoding in original program is 1, but 131 in bolted program. Moreover, many lsda information were deleted in .eh_frame section of bolted program.
Any help will be pleasure.