[PATCH] D140931: Improve and enable folding of conditional branches with tail calls.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 08:40:49 PST 2023


hctim added a comment.

Hey, looks like this probably broke the ASan buildbot: https://lab.llvm.org/buildbot/#/builders/5/builds/31141/steps/13/logs/stdio

I'm running a bisect now just to double check.

Instructions on how to reproduce the bots can be found here: https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild. You're probably looking for `buildbot_fast.sh`, the same one that's referenced in the instructions.

  Testing:  0.. 10.. 20.. 30.. 40.. 50..
  FAIL: LLVM :: CodeGen/X86/tailcall-extract.ll (42751 of 72693)
  ******************** TEST 'LLVM :: CodeGen/X86/tailcall-extract.ll' FAILED ********************
  Script:
  --
  : 'RUN: at line 1';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/llc -opaque-pointers=0 -mtriple=x86_64-linux < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/X86/tailcall-extract.ll | /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/X86/tailcall-extract.ll
  : 'RUN: at line 2';   /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/opt -opaque-pointers=0 -codegenprepare -S -mtriple=x86_64-linux < /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/X86/tailcall-extract.ll | /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/X86/tailcall-extract.ll --check-prefix OPT
  --
  Exit Code: 2
  Command Output (stderr):
  --
  =================================================================
  ==1490386==ERROR: AddressSanitizer: container-overflow on address 0x602000006718 at pc 0x55bf6065a91e bp 0x7ffc1fdaeed0 sp 0x7ffc1fdaeec8
  READ of size 8 at 0x602000006718 thread T0
      #0 0x55bf6065a91d in llvm::BranchFolder::OptimizeBlock(llvm::MachineBasicBlock*) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp:1517:34
      #1 0x55bf60649db4 in llvm::BranchFolder::OptimizeBranches(llvm::MachineFunction&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp:1207:19
      #2 0x55bf606465b7 in llvm::BranchFolder::OptimizeFunction(llvm::MachineFunction&, llvm::TargetInstrInfo const*, llvm::TargetRegisterInfo const*, llvm::MachineLoopInfo*, bool) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp:212:34
      #3 0x55bf60660955 in (anonymous namespace)::BranchFolderPass::runOnMachineFunction(llvm::MachineFunction&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp:137:17
      #4 0x55bf60b3be12 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:13
      #5 0x55bf61a80e73 in llvm::FPPassManager::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1430:27
      #6 0x55bf61a9aa70 in llvm::FPPassManager::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1476:16
      #7 0x55bf61a82ce2 in runOnModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1545:27
      #8 0x55bf61a82ce2 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:44
      #9 0x55bf5b7d7904 in compileModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:733:8
      #10 0x55bf5b7d7904 in main /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:420:22
      #11 0x7f6384b17d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
      #12 0x7f6384b17e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
      #13 0x55bf5b704064 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/llc+0x751c064)
  0x602000006718 is located 8 bytes inside of 16-byte region [0x602000006710,0x602000006720)
  allocated by thread T0 here:
      #0 0x55bf5b7c3bcd in operator new(unsigned long) /b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:95:3
      #1 0x55bf5c95c847 in __libcpp_operator_new<unsigned long> /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/new:266:10
      #2 0x55bf5c95c847 in __libcpp_allocate /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/new:292:10
      #3 0x55bf5c95c847 in allocate /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/__memory/allocator.h:115:38
      #4 0x55bf5c95c847 in __allocate_at_least<std::__1::allocator<llvm::MachineBasicBlock *> > /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/__memory/allocate_at_least.h:55:19
      #5 0x55bf5c95c847 in __split_buffer /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/__split_buffer:323:29
      #6 0x55bf5c95c847 in void std::__1::vector<llvm::MachineBasicBlock*, std::__1::allocator<llvm::MachineBasicBlock*>>::__push_back_slow_path<llvm::MachineBasicBlock* const&>(llvm::MachineBasicBlock* const&) /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/vector:1538:49
      #7 0x55bf609e858b in push_back /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/vector:1556:9
      #8 0x55bf609e858b in addPredecessor /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineBasicBlock.cpp:882:16
      #9 0x55bf609e858b in llvm::MachineBasicBlock::addSuccessor(llvm::MachineBasicBlock*, llvm::BranchProbability) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineBasicBlock.cpp:779:9
      #10 0x55bf62e4b401 in addSuccessorWithProb /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:2196:10
      #11 0x55bf62e4b401 in llvm::SelectionDAGBuilder::visitSwitchCase(llvm::SwitchCG::CaseBlock&, llvm::MachineBasicBlock*) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:2576:3
      #12 0x55bf63063ffe in llvm::SelectionDAGISel::FinishBasicBlock() /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1876:10
      #13 0x55bf630506c3 in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1644:5
      #14 0x55bf630464c4 in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:480:3
      #15 0x55bf5f5032f9 in (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:191:25
      #16 0x55bf60b3be12 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:13
      #17 0x55bf61a80e73 in llvm::FPPassManager::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1430:27
      #18 0x55bf61a9aa70 in llvm::FPPassManager::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1476:16
      #19 0x55bf61a82ce2 in runOnModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1545:27
      #20 0x55bf61a82ce2 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:44
      #21 0x55bf5b7d7904 in compileModule /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:733:8
      #22 0x55bf5b7d7904 in main /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:420:22
      #23 0x7f6384b17d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
  HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_container_overflow=0.
  If you suspect a false positive see also: https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow.
  SUMMARY: AddressSanitizer: container-overflow /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/CodeGen/BranchFolding.cpp:1517:34 in llvm::BranchFolder::OptimizeBlock(llvm::MachineBasicBlock*)
  Shadow bytes around the buggy address:
    0x0c047fff8c90: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
    0x0c047fff8ca0: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fd
    0x0c047fff8cb0: fa fa 00 fa fa fa fd fa fa fa fd fa fa fa fd fa
    0x0c047fff8cc0: fa fa 04 fa fa fa 00 fc fa fa 00 fa fa fa fd fd
    0x0c047fff8cd0: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fa
  =>0x0c047fff8ce0: fa fa 00[fc]fa fa 00 fa fa fa 00 00 fa fa 00 fa
    0x0c047fff8cf0: fa fa fd fd fa fa fd fd fa fa fd fa fa fa fd fd
    0x0c047fff8d00: fa fa fd fa fa fa fd fa fa fa fd fd fa fa fd fd
    0x0c047fff8d10: fa fa fd fa fa fa fd fa fa fa fd fd fa fa 00 00
    0x0c047fff8d20: fa fa 00 00 fa fa fd fa fa fa fd fd fa fa fd fd
    0x0c047fff8d30: fa fa 00 00 fa fa 00 00 fa fa 00 00 fa fa fd fd
  Shadow byte legend (one shadow byte represents 8 application bytes):
    Addressable:           00
    Partially addressable: 01 02 03 04 05 06 07 
    Heap left redzone:       fa
    Freed heap region:       fd
    Stack left redzone:      f1
    Stack mid redzone:       f2
    Stack right redzone:     f3
    Stack after return:      f5
    Stack use after scope:   f8
    Global redzone:          f9
    Global init order:       f6
    Poisoned by user:        f7
    Container overflow:      fc
    Array cookie:            ac
    Intra object redzone:    bb
    ASan internal:           fe
    Left alloca redzone:     ca
    Right alloca redzone:    cb
  ==1490386==ABORTING
  FileCheck error: '<stdin>' is empty.
  FileCheck command line:  /b/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/FileCheck /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/CodeGen/X86/tailcall-extract.ll
  --


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140931/new/

https://reviews.llvm.org/D140931



More information about the llvm-commits mailing list