[PATCH] D17337: __builtin_object_size problem with pointer as argument

Petar Jovanovic via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 17:38:32 PST 2016


petarj added a comment.

In http://reviews.llvm.org/D17337#369422, @george.burgess.iv wrote:

> That's... concerning, especially given that there doesn't seem to be a bug filed about this behavior. Can you paste the errors that UBSan gives you, please?


I reverted the change since it broke LLVM UBSan bilder <http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/10683>.

Here is the error:

  FAIL: LLVM :: Transforms/InstCombine/builtin-object-size-ptr.ll (12303 of 15979)
  ******************** TEST 'LLVM :: Transforms/InstCombine/builtin-object-size-ptr.ll' FAILED ********************
  Script:
  --
  /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/./bin/opt -instcombine -S < /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/test/Transforms/InstCombine/builtin-object-size-ptr.ll | /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/./bin/FileCheck /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/test/Transforms/InstCombine/builtin-object-size-ptr.ll
  --
  Exit Code: 2
  
  Command Output (stderr):
  --
  /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/ValueHandle.h:101:37: runtime error: reference binding to null pointer of type 'llvm::Value'
      #0 0x1aa9282 in llvm::ValueHandleBase::operator*() const /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/ValueHandle.h:101:30
      #1 0x22b1149 in llvm::InstCombiner::visitAllocSite(llvm::Instruction&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:1964:51
      #2 0x2341631 in llvm::InstCombiner::visitAllocaInst(llvm::AllocaInst&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:308:10
      #3 0x22b5686 in llvm::InstCombiner::run() /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2839:31
      #4 0x22b6856 in combineInstructionsOverFunction(llvm::Function&, llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::DominatorTree&, llvm::LoopInfo*) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3065:16
      #5 0x22b7e34 in (anonymous namespace)::InstructionCombiningPass::runOnFunction(llvm::Function&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3140:10
      #6 0x20c952e in llvm::FPPassManager::runOnFunction(llvm::Function&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1550:23
      #7 0x20c990b in llvm::FPPassManager::runOnModule(llvm::Module&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1571:16
      #8 0x20ca420 in (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1627:23
      #9 0x20c9d55 in llvm::legacy::PassManagerImpl::run(llvm::Module&) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/LegacyPassManager.cpp:1730:16
      #10 0x947df5 in main /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/opt/opt.cpp:628:3
      #11 0x7f3096470ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
      #12 0x8ebc36 in _start (/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_ubsan/bin/opt+0x8ebc36)


Repository:
  rL LLVM

http://reviews.llvm.org/D17337





More information about the llvm-commits mailing list