Skip to content

Instantly share code, notes, and snippets.

@commander-trashdin
Created October 18, 2019 17:15
Show Gist options
  • Save commander-trashdin/1fa6101ebeb145a7d4e02212dd29e183 to your computer and use it in GitHub Desktop.
Save commander-trashdin/1fa6101ebeb145a7d4e02212dd29e183 to your computer and use it in GitHub Desktop.
adresses
==8770==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000420 at pc 0x564675a30975 bp 0x7fff37d52420 sp 0x7fff37d52418
READ of size 8 at 0x602000000420 thread T0
#0 0x564675a30974 in std::enable_if<std::__and_<std::__not_<std::__is_tuple_like<Block*> >, std::is_move_constructible<Block*>, std::is_move_assignable<Block*> >::value, void>::type std::swap<Block*>(Block*&, Block*&) (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x579974)
#1 0x564675a2cfcf in std::unique_ptr<Block, std::default_delete<Block> >::reset(Block*) (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x575fcf)
#2 0x564675a29815 in std::unique_ptr<Block, std::default_delete<Block> >::operator=(std::unique_ptr<Block, std::default_delete<Block> >&&) (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x572815)
#3 0x564675a277ab in Deque::Reserve(unsigned long) (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x5707ab)
#4 0x564675a27b81 in Deque::Realloc() (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x570b81)
#5 0x564675a27d68 in Deque::PushBlockBack() (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x570d68)
#6 0x564675a24c71 in Deque::PushBack(int) (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x56dc71)
#7 0x564675a1f9c4 in ____C_A_T_C_H____T_E_S_T____8 /home/aun/SDA/shad-cpp0/deque/test.cpp:75
#8 0x564675aad742 in Catch::TestInvokerAsFunction::invoke() const /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:10271
#9 0x564675aa9f1c in Catch::TestCase::invoke() const /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:10172
#10 0x564675a8e3ce in Catch::RunContext::invokeActiveTestCase() /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9043
#11 0x564675a8cc82 in Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9017
#12 0x564675a821c1 in Catch::RunContext::runTest(Catch::TestCase const&) /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:8800
#13 0x564675a95f95 in runTests /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9339
#14 0x564675a9d6f1 in Catch::Session::runInternal() /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9537
#15 0x564675a9c028 in Catch::Session::run() /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9494
#16 0x564675a9bc60 in Catch::Session::run(int, char**) /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9462
#17 0x564675b07539 in main /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:12987
#18 0x7f6ef8752bba in __libc_start_main ../csu/libc-start.c:308
#19 0x564675a1acf9 in _start (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x563cf9)
0x602000000420 is located 0 bytes to the right of 16-byte region [0x602000000410,0x602000000420)
allocated by thread T0 here:
#0 0x7f6ef954e27f in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10927f)
#1 0x564675a29039 in std::_MakeUniq<std::unique_ptr<Block, std::default_delete<Block> > []>::__array std::make_unique<std::unique_ptr<Block, std::default_delete<Block> > []>(unsigned long) (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x572039)
#2 0x564675a274cb in Deque::Reserve(unsigned long) (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x5704cb)
#3 0x564675a27b81 in Deque::Realloc() (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x570b81)
#4 0x564675a27d68 in Deque::PushBlockBack() (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x570d68)
#5 0x564675a24c71 in Deque::PushBack(int) (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x56dc71)
#6 0x564675a1f9c4 in ____C_A_T_C_H____T_E_S_T____8 /home/aun/SDA/shad-cpp0/deque/test.cpp:75
#7 0x564675aad742 in Catch::TestInvokerAsFunction::invoke() const /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:10271
#8 0x564675aa9f1c in Catch::TestCase::invoke() const /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:10172
#9 0x564675a8e3ce in Catch::RunContext::invokeActiveTestCase() /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9043
#10 0x564675a8cc82 in Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9017
#11 0x564675a821c1 in Catch::RunContext::runTest(Catch::TestCase const&) /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:8800
#12 0x564675a95f95 in runTests /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9339
#13 0x564675a9d6f1 in Catch::Session::runInternal() /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9537
#14 0x564675a9c028 in Catch::Session::run() /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9494
#15 0x564675a9bc60 in Catch::Session::run(int, char**) /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:9462
#16 0x564675b07539 in main /home/aun/SDA/shad-cpp0/contrib/catch/catch.hpp:12987
#17 0x7f6ef8752bba in __libc_start_main ../csu/libc-start.c:308
SUMMARY: AddressSanitizer: heap-buffer-overflow (/home/aun/SDA/shad-cpp0/asan_build/test_deque+0x579974) in std::enable_if<std::__and_<std::__not_<std::__is_tuple_like<Block*> >, std::is_move_constructible<Block*>, std::is_move_assignable<Block*> >::value, void>::type std::swap<Block*>(Block*&, Block*&)
Shadow bytes around the buggy address:
0x0c047fff8030: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
0x0c047fff8040: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fd
0x0c047fff8050: fa fa fd fd fa fa fd fd fa fa fd fa fa fa fd fa
0x0c047fff8060: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd
0x0c047fff8070: fa fa 00 00 fa fa 00 00 fa fa fd fa fa fa fd fd
=>0x0c047fff8080: fa fa 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff80a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff80b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff80c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff80d0: 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
Shadow gap: cc
==8770==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment