BOLT icon indicating copy to clipboard operation
BOLT copied to clipboard

perf2bolt: JumpTableBD->getEndAddress() <= UpperBound ERROR

Open zpget opened this issue 3 years ago • 5 comments

BOLT-ERROR:JumpTableBD->getEndAddress() <= UpperBound, address 0x44ac618 type:1 in function protobuf_common_5finfo_2eproto12_GLOBAL__N_126protobuf_AssignDescriptorsEv/1(2)3338perf2bolt: llvm/tools/llvm-bolt/src/BinaryContext.cpp:577: bool llvm::bolt::BinaryContext::analyzeJumpTable(uint64_t, llvm::bolt::JumpTable::JumpTableType, llvm::bolt::BinaryFunction&, uint64_t, llvm::bolt::JumpTable::OffsetsType): Assertion `JumpTableBD->getEndAddress() <= UpperBound && "data object cannot cross a section boundary"' failed.

zpget avatar May 10 '21 07:05 zpget

Hi, can you please share steps for us to repro the issue? What’s the program you’re running perf2bolt on, the OS, which compiler is used with which options.

aaupov avatar May 10 '21 07:05 aaupov

Hi, can you please share steps for us to repro the issue? What’s the program you’re running perf2bolt on, the OS, which compiler is used with which options.

self develop program x86_64 GNU/Linux gcc10, options are many : -msse3 -pipe -fPIC -Wextra -Wall -Wno-parentheses -Wno-unused-parameter -Wno-unused-local-typedefs -Wno-deprecated-declarations -pthread -std=c++11 -fno-omit-frame-pointer -Werror=return-local-addr -Werror=return-type -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable

zpget avatar May 10 '21 07:05 zpget

@zpget Hello. Will the -fno-reorder-blocks-and-partition flag make any difference?

yota9 avatar May 10 '21 07:05 yota9

@zpget Hello. Will the -fno-reorder-blocks-and-partition flag make any difference?

add -fno-reorder-blocks-and-partition remian the same core bolt:llvm/tools/llvm-bolt/src/BinaryContext.cpp:577: bool llvm::bolt::BinaryContext::analyzeJumpTable(uint64_t, llvm::bolt::JumpTable::JumpTableType, llvm::bolt::BinaryFunction&, uint64_t, llvm::bolt::JumpTable::OffsetsType*): Assertion `JumpTableBD->getEndAddress() <= UpperBound && "data object cannot cross a section boundary"' failed.

zpget avatar May 10 '21 08:05 zpget

Thank you for more details! Thank you @yota9 for on-spot suggestion. One thing I've noticed is that you don't have options to preserve relocations in the resulting binary. Can you please add -Wl,--emit-relocs -znow to you compilation flags and verify if the issue persists?

aaupov avatar May 11 '21 06:05 aaupov