Skip to content

Instantly share code, notes, and snippets.

@lattera
Last active December 26, 2017 22:59
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 lattera/d3cfd1a6ec03549e2495c0da6d040a0b to your computer and use it in GitHub Desktop.
Save lattera/d3cfd1a6ec03549e2495c0da6d040a0b to your computer and use it in GitHub Desktop.
=================================================================
==57527==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000039c at pc 0x01be7b1e786c bp 0x7fffffe49320 sp 0x7fffffe48ad0
READ of size 16 at 0x60200000039c thread T0
#0 0x1be7b1e786b in __asan_memcpy /usr/src/contrib/compiler-rt/lib/asan/asan_interceptors.cc:466:3
#1 0x1be7b20f2c5 in __construct_backward<unsigned int> /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/include/c++/v1/memory:1652:17
#2 0x1be7b20f2c5 in std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >::__swap_out_circular_buffer(std::__1::__split_buffer<unsigned int, std::__1::allocator<unsigned int>&>&) /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/include/c++/v1/vector:898
#3 0x1be7b20ede6 in _ZNSt3__16vectorIjNS_9allocatorIjEEE21__push_back_slow_pathIRKjEEvOT_ /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/include/c++/v1/vector:1582:5
#4 0x1be7b2cfd08 in push_back /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/include/c++/v1/vector:1599:9
#5 0x1be7b2cfd08 in writeSymbolTable /scratch/hbsd-playground/contrib/llvm/lib/Object/ArchiveWriter.cpp:329
#6 0x1be7b2cf460 in llvm::writeArchive(llvm::StringRef, std::__1::vector<llvm::NewArchiveMember, llvm::StringRef::allocator<std::__1::vector> >&, bool, llvm::object::Archive::Kind, bool, bool, llvm::StringRef::unique_ptr<llvm::MemoryBuffer, llvm::StringRef::default_delete<llvm::StringRef::unique_ptr> >) /scratch/hbsd-playground/contrib/llvm/lib/Object/ArchiveWriter.cpp:403:52
#7 0x1be7b214d10 in performWriteOperation /scratch/hbsd-playground/contrib/llvm/tools/llvm-ar/llvm-ar.cpp:694:7
#8 0x1be7b213691 in performOperation /scratch/hbsd-playground/contrib/llvm/tools/llvm-ar/llvm-ar.cpp:727:5
#9 0x1be7b2123e6 in performOperation /scratch/hbsd-playground/contrib/llvm/tools/llvm-ar/llvm-ar.cpp:767:3
#10 0x1be7b20c8c1 /scratch/hbsd-playground/contrib/llvm/tools/llvm-ar/llvm-ar.cpp:847:10
#11 0x1be7b20c346 in main /scratch/hbsd-playground/contrib/llvm/tools/llvm-ar/llvm-ar.cpp:904:12
#12 0x1be7b18805f in _start /scratch/hbsd-playground/lib/csu/amd64/crt1.c:74:7
0x6020000003a0 is located 0 bytes to the right of 16-byte region [0x602000000390,0x6020000003a0)
allocated by thread T0 here:
#0 0x1be7b208412 in operator new(unsigned long) /usr/src/contrib/compiler-rt/lib/asan/asan_new_delete.cc:92:3
#1 0x1be7b20f001 in __allocate /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/include/c++/v1/new:226:10
#2 0x1be7b20f001 in allocate /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/include/c++/v1/memory:1747
#3 0x1be7b20f001 in allocate /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/include/c++/v1/memory:1502
#4 0x1be7b20f001 in std::__1::__split_buffer<unsigned int, std::__1::allocator<unsigned int>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<unsigned int>&) /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/include/c++/v1/__split_buffer:311
#5 0x1be7b20ed67 in _ZNSt3__16vectorIjNS_9allocatorIjEEE21__push_back_slow_pathIRKjEEvOT_ /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/include/c++/v1/vector:1578:49
#6 0x1be7b2cfd08 in push_back /usr/obj/scratch/hbsd-playground/amd64.amd64/tmp/usr/include/c++/v1/vector:1599:9
#7 0x1be7b2cfd08 in writeSymbolTable /scratch/hbsd-playground/contrib/llvm/lib/Object/ArchiveWriter.cpp:329
#8 0x1be7b2cf460 in llvm::writeArchive(llvm::StringRef, std::__1::vector<llvm::NewArchiveMember, llvm::StringRef::allocator<std::__1::vector> >&, bool, llvm::object::Archive::Kind, bool, bool, llvm::StringRef::unique_ptr<llvm::MemoryBuffer, llvm::StringRef::default_delete<llvm::StringRef::unique_ptr> >) /scratch/hbsd-playground/contrib/llvm/lib/Object/ArchiveWriter.cpp:403:52
#9 0x1be7b214d10 in performWriteOperation /scratch/hbsd-playground/contrib/llvm/tools/llvm-ar/llvm-ar.cpp:694:7
#10 0x1be7b213691 in performOperation /scratch/hbsd-playground/contrib/llvm/tools/llvm-ar/llvm-ar.cpp:727:5
#11 0x1be7b2123e6 in performOperation /scratch/hbsd-playground/contrib/llvm/tools/llvm-ar/llvm-ar.cpp:767:3
#12 0x1be7b20c8c1 /scratch/hbsd-playground/contrib/llvm/tools/llvm-ar/llvm-ar.cpp:847:10
#13 0x1be7b20c346 in main /scratch/hbsd-playground/contrib/llvm/tools/llvm-ar/llvm-ar.cpp:904:12
#14 0x1be7b18805f in _start /scratch/hbsd-playground/lib/csu/amd64/crt1.c:74:7
#15 0x2c3be702fff (<unknown module>)
SUMMARY: AddressSanitizer: heap-buffer-overflow /usr/src/contrib/compiler-rt/lib/asan/asan_interceptors.cc:466:3 in __asan_memcpy
Shadow bytes around the buggy address:
0x4c0400000020: fa fa 00 fa fa fa fd fa fa fa fd fa fa fa fd fd
0x4c0400000030: fa fa fd fd fa fa 00 04 fa fa 00 05 fa fa 00 05
0x4c0400000040: fa fa 00 07 fa fa 00 06 fa fa 00 00 fa fa 00 00
0x4c0400000050: fa fa 00 06 fa fa 00 05 fa fa 00 06 fa fa 00 00
0x4c0400000060: fa fa 00 01 fa fa 00 fa fa fa fd fa fa fa fd fa
=>0x4c0400000070: fa fa 00[04]fa fa fa fa fa fa fa fa fa fa fa fa
0x4c0400000080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x4c0400000090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x4c04000000a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x4c04000000b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x4c04000000c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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
==57527==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment