Skip to content

Instantly share code, notes, and snippets.

@zygoloid
Created September 2, 2022 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zygoloid/a270e65d32ab5b05504b3b0d5717f83b to your computer and use it in GitHub Desktop.
Save zygoloid/a270e65d32ab5b05504b3b0d5717f83b to your computer and use it in GitHub Desktop.
=================================================================
==9363==ERROR: AddressSanitizer: heap-use-after-free on address 0x60d0000044d0 at pc 0x55dda07a9508 bp 0x7ffd54523e50 sp 0x7ffd54523e48
READ of size 1 at 0x60d0000044d0 thread T0
#0 0x55dda07a9507 in getValueID third_party/llvm/llvm-project/llvm/include/llvm/IR/Value.h:533:12
#1 0x55dda07a9507 in getOpcode third_party/llvm/llvm-project/llvm/include/llvm/IR/Instruction.h:164:39
#2 0x55dda07a9507 in classof third_party/llvm/llvm-project/llvm/include/llvm/IR/Instructions.h:273:15
#3 0x55dda07a9507 in doit third_party/llvm/llvm-project/llvm/include/llvm/Support/Casting.h:64:53
#4 0x55dda07a9507 in doit third_party/llvm/llvm-project/llvm/include/llvm/Support/Casting.h:110:12
#5 0x55dda07a9507 in doit third_party/llvm/llvm-project/llvm/include/llvm/Support/Casting.h:137:12
#6 0x55dda07a9507 in doit third_party/llvm/llvm-project/llvm/include/llvm/Support/Casting.h:127:12
#7 0x55dda07a9507 in isPossible third_party/llvm/llvm-project/llvm/include/llvm/Support/Casting.h:255:12
#8 0x55dda07a9507 in doCastIfPossible third_party/llvm/llvm-project/llvm/include/llvm/Support/Casting.h:494:10
#9 0x55dda07a9507 in dyn_cast<llvm::LoadInst, llvm::Instruction> third_party/llvm/llvm-project/llvm/include/llvm/Support/Casting.h:608:10
#10 0x55dda07a9507 in tryToRecognizeTableBasedCttz third_party/llvm/llvm-project/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:555:18
#11 0x55dda07a9507 in foldUnusualPatterns(llvm::Function&, llvm::DominatorTree&, llvm::TargetTransformInfo&, llvm::TargetLibraryInfo&) third_party/llvm/llvm-project/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:661:21
#12 0x55dda07a56d9 in runImpl(llvm::Function&, llvm::AssumptionCache&, llvm::TargetTransformInfo&, llvm::TargetLibraryInfo&, llvm::DominatorTree&) third_party/llvm/llvm-project/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:681:17
#13 0x55dda07a5201 in llvm::AggressiveInstCombinePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) third_party/llvm/llvm-project/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:712:8
#14 0x55dd9ec19cd1 in llvm::detail::PassModel<llvm::Function, llvm::AggressiveInstCombinePass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#15 0x55dda1c3ed40 in llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManager.h:520:24
#16 0x55dd9d932e51 in llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#17 0x55dda1c3c577 in llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) third_party/llvm/llvm-project/llvm/lib/IR/PassManager.cpp:127:22
#18 0x55dd9d932991 in llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#19 0x55dda1c3d159 in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManager.h:520:24
#20 0x55dd9ce08ec1 in llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::ArrayRef<llvm::PassPlugin>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool) third_party/llvm/llvm-project/llvm/tools/opt/NewPMDriver.cpp:525:7
#21 0x55dd9ce27c7c in main third_party/llvm/llvm-project/llvm/tools/opt/opt.cpp:783:12
#22 0x7f95528f7632 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x61632) (BuildId: 280088eab084c30a3992a9bce5c35b44)
#23 0x55dd9cd2e229 in _start /build/work/ab393f4ac612f9027aae6b1a7226027ba2a2/google3/blaze-out/k8-opt/bin/third_party/grte/v5_src/grte-scratch/BUILD/src/csu/../sysdeps/x86_64/start.S:120
0x60d0000044d0 is located 80 bytes inside of 144-byte region [0x60d000004480,0x60d000004510)
freed by thread T0 here:
#0 0x55dd9cdff45d in operator delete(void*) third_party/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:152:3
#1 0x55dda1b8d5c4 in deleteNode third_party/llvm/llvm-project/llvm/include/llvm/IR/Instruction.h:859:6
#2 0x55dda1b8d5c4 in erase third_party/llvm/llvm-project/llvm/include/llvm/ADT/ilist.h:269:5
#3 0x55dda1b8d5c4 in llvm::Instruction::eraseFromParent() third_party/llvm/llvm-project/llvm/lib/IR/Instruction.cpp:78:37
#4 0x55dda07ab025 in foldSqrt third_party/llvm/llvm-project/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:469:7
#5 0x55dda07ab025 in foldUnusualPatterns(llvm::Function&, llvm::DominatorTree&, llvm::TargetTransformInfo&, llvm::TargetLibraryInfo&) third_party/llvm/llvm-project/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:660:21
#6 0x55dda07a56d9 in runImpl(llvm::Function&, llvm::AssumptionCache&, llvm::TargetTransformInfo&, llvm::TargetLibraryInfo&, llvm::DominatorTree&) third_party/llvm/llvm-project/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:681:17
#7 0x55dda07a5201 in llvm::AggressiveInstCombinePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) third_party/llvm/llvm-project/llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:712:8
#8 0x55dd9ec19cd1 in llvm::detail::PassModel<llvm::Function, llvm::AggressiveInstCombinePass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#9 0x55dda1c3ed40 in llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManager.h:520:24
#10 0x55dd9d932e51 in llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#11 0x55dda1c3c577 in llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) third_party/llvm/llvm-project/llvm/lib/IR/PassManager.cpp:127:22
#12 0x55dd9d932991 in llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:88:17
#13 0x55dda1c3d159 in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManager.h:520:24
#14 0x55dd9ce08ec1 in llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::ArrayRef<llvm::PassPlugin>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool) third_party/llvm/llvm-project/llvm/tools/opt/NewPMDriver.cpp:525:7
#15 0x55dd9ce27c7c in main third_party/llvm/llvm-project/llvm/tools/opt/opt.cpp:783:12
#16 0x7f95528f7632 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x61632) (BuildId: 280088eab084c30a3992a9bce5c35b44)
#17 0x55dd9cd2e229 in _start /build/work/ab393f4ac612f9027aae6b1a7226027ba2a2/google3/blaze-out/k8-opt/bin/third_party/grte/v5_src/grte-scratch/BUILD/src/csu/../sysdeps/x86_64/start.S:120
previously allocated by thread T0 here:
#0 0x55dd9cdfebdd in operator new(unsigned long) third_party/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:95:3
#1 0x55dda1c74aa0 in allocateFixedOperandUser third_party/llvm/llvm-project/llvm/lib/IR/User.cpp:135:7
#2 0x55dda1c74aa0 in llvm::User::operator new(unsigned long, unsigned int, unsigned int) third_party/llvm/llvm-project/llvm/lib/IR/User.cpp:158:10
#3 0x55dd9d132682 in llvm::CallInst::Create(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*>>, llvm::Twine const&, llvm::Instruction*) third_party/llvm/llvm-project/llvm/include/llvm/IR/Instructions.h:1537:12
#4 0x55dda016a417 in llvm::LLParser::parseCall(llvm::Instruction*&, llvm::LLParser::PerFunctionState&, llvm::CallInst::TailCallKind) third_party/llvm/llvm-project/llvm/lib/AsmParser/LLParser.cpp:7182:18
#5 0x55dda015d215 in llvm::LLParser::parseInstruction(llvm::Instruction*&, llvm::BasicBlock*, llvm::LLParser::PerFunctionState&) third_party/llvm/llvm-project/llvm/lib/AsmParser/LLParser.cpp
#6 0x55dda015c7c6 in llvm::LLParser::parseBasicBlock(llvm::LLParser::PerFunctionState&) third_party/llvm/llvm-project/llvm/lib/AsmParser/LLParser.cpp:5935:13
#7 0x55dda011c2bf in llvm::LLParser::parseFunctionBody(llvm::Function&) third_party/llvm/llvm-project/llvm/lib/AsmParser/LLParser.cpp:5879:9
#8 0x55dda0112f23 in llvm::LLParser::parseDefine() third_party/llvm/llvm-project/llvm/lib/AsmParser/LLParser.cpp:568:10
#9 0x55dda010e236 in llvm::LLParser::parseTopLevelEntities() third_party/llvm/llvm-project/llvm/lib/AsmParser/LLParser.cpp:374:11
#10 0x55dda010df5d in llvm::LLParser::Run(bool, llvm::function_ref<llvm::Optional<std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>> (llvm::StringRef)>) third_party/llvm/llvm-project/llvm/lib/AsmParser/LLParser.cpp:103:10
#11 0x55dda00fc628 in parseAssemblyInto(llvm::MemoryBufferRef, llvm::Module*, llvm::ModuleSummaryIndex*, llvm::SMDiagnostic&, llvm::SlotMapping*, bool, llvm::function_ref<llvm::Optional<std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>> (llvm::StringRef)>) third_party/llvm/llvm-project/llvm/lib/AsmParser/Parser.cpp:34:8
#12 0x55dda00fc840 in parseAssemblyInto third_party/llvm/llvm-project/llvm/lib/AsmParser/Parser.cpp:41:10
#13 0x55dda00fc840 in llvm::parseAssembly(llvm::MemoryBufferRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::SlotMapping*, llvm::function_ref<llvm::Optional<std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>> (llvm::StringRef)>) third_party/llvm/llvm-project/llvm/lib/AsmParser/Parser.cpp:52:7
#14 0x55dda00fa5ad in llvm::parseIR(llvm::MemoryBufferRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::function_ref<llvm::Optional<std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>> (llvm::StringRef)>) third_party/llvm/llvm-project/llvm/lib/IRReader/IRReader.cpp:88:10
#15 0x55dda00fad98 in llvm::parseIRFile(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::function_ref<llvm::Optional<std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>> (llvm::StringRef)>) third_party/llvm/llvm-project/llvm/lib/IRReader/IRReader.cpp:102:10
#16 0x55dd9ce23cda in main third_party/llvm/llvm-project/llvm/tools/opt/opt.cpp:604:9
#17 0x7f95528f7632 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x61632) (BuildId: 280088eab084c30a3992a9bce5c35b44)
#18 0x55dd9cd2e229 in _start /build/work/ab393f4ac612f9027aae6b1a7226027ba2a2/google3/blaze-out/k8-opt/bin/third_party/grte/v5_src/grte-scratch/BUILD/src/csu/../sysdeps/x86_64/start.S:120
SUMMARY: AddressSanitizer: heap-use-after-free third_party/llvm/llvm-project/llvm/include/llvm/IR/Value.h:533:12 in getValueID
Shadow bytes around the buggy address:
0x0c1a7fff8840: fa fa 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c1a7fff8850: 00 00 04 fa fa fa fa fa fa fa fa fa 00 00 00 00
0x0c1a7fff8860: 00 00 00 00 00 00 00 00 00 00 00 00 04 fa fa fa
0x0c1a7fff8870: fa fa fa fa fa fa 00 00 00 00 00 00 00 00 00 00
0x0c1a7fff8880: 00 00 00 00 00 00 04 fa fa fa fa fa fa fa fa fa
=>0x0c1a7fff8890: fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd
0x0c1a7fff88a0: fd fd fa fa fa fa fa fa fa fa 00 00 00 00 00 00
0x0c1a7fff88b0: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
0x0c1a7fff88c0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
0x0c1a7fff88d0: 00 00 00 00 00 00 fa fa fa fa fa fa fa fa 00 00
0x0c1a7fff88e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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
==9363==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment