================================================================= ==10780==ERROR: AddressSanitizer: heap-use-after-free on address 0x61500005b9d8 at pc 0x0000004eb159 bp 0x7fd6903fe670 sp 0x7fd6903fe660 WRITE of size 8 at 0x61500005b9d8 thread T1 initialization #0 0x4eb158 in std::_Function_base::_Base_manager::_M_clone(std::_Any_data&, std::_Function_base::_Base_manager const&, std::integral_constant) /usr/include/c++/5/functional:1710 #1 0x4eb158 in std::_Function_base::_Base_manager::_M_manager(std::_Any_data&, std::_Function_base::_Base_manager const&, std::_Manager_operation) /usr/include/c++/5/functional:1746 #2 0x4fe7a0 in std::function::function(std::function const&) /usr/include/c++/5/functional:2238 #3 0x4fe7a0 in tacopie::tcp_client::read_request::read_request(tacopie::tcp_client::read_request const&) /home/lexy/code/gdcloud/Libraries/cpp_redis/deps/include/tacopie/network/tcp_client.hpp:88 #4 0x4fe7a0 in void __gnu_cxx::new_allocator::construct(tacopie::tcp_client::read_request*, tacopie::tcp_client::read_request const&) /usr/include/c++/5/ext/new_allocator.h:120 #5 0x4fe7a0 in void std::allocator_traits >::construct(std::allocator&, tacopie::tcp_client::read_request*, tacopie::tcp_client::read_request const&) /usr/include/c++/5/bits/alloc_traits.h:530 #6 0x4fe7a0 in std::deque >::push_back(tacopie::tcp_client::read_request const&) /usr/include/c++/5/bits/stl_deque.h:1521 #7 0x4fe7a0 in std::queue > >::push(tacopie::tcp_client::read_request const&) /usr/include/c++/5/bits/stl_queue.h:216 #8 0x4fe7a0 in tacopie::tcp_client::async_read(tacopie::tcp_client::read_request const&) /home/lexy/code/gdcloud/Libraries/cpp_redis/tacopie/sources/network/tcp_client.cpp:200 #9 0x4e9d70 in cpp_redis::network::tcp_client::async_read(cpp_redis::network::tcp_client_iface::read_request&) /home/lexy/code/gdcloud/Libraries/cpp_redis/includes/cpp_redis/network/tcp_client.hpp:71 #10 0x4e9d70 in cpp_redis::network::redis_connection::tcp_client_receive_handler(cpp_redis::network::tcp_client_iface::read_result const&) /home/lexy/code/gdcloud/Libraries/cpp_redis/sources/network/redis_connection.cpp:170 #11 0x4eae56 in std::function::operator()(cpp_redis::network::tcp_client_iface::read_result&) const /usr/include/c++/5/functional:2267 #12 0x4eae56 in cpp_redis::network::tcp_client::async_read(cpp_redis::network::tcp_client_iface::read_request&)::{lambda(tacopie::tcp_client::read_result&)#1}::operator()(tacopie::tcp_client::read_result&) const /home/lexy/code/gdcloud/Libraries/cpp_redis/includes/cpp_redis/network/tcp_client.hpp:70 #13 0x4eae56 in std::_Function_handler::_M_invoke(std::_Any_data const&, tacopie::tcp_client::read_result&) /usr/include/c++/5/functional:1871 #14 0x4f9968 in std::function::operator()(tacopie::tcp_client::read_result&) const /usr/include/c++/5/functional:2267 #15 0x4f9968 in tacopie::tcp_client::on_read_available(int) /home/lexy/code/gdcloud/Libraries/cpp_redis/tacopie/sources/network/tcp_client.cpp:112 #16 0x50783a in std::function::operator()(int) const /usr/include/c++/5/functional:2267 #17 0x50783a in operator() /home/lexy/code/gdcloud/Libraries/cpp_redis/tacopie/sources/network/unix/io_service.cpp:144 #18 0x50783a in _M_invoke /usr/include/c++/5/functional:1871 #19 0x50be95 in std::function::operator()() const /usr/include/c++/5/functional:2267 #20 0x50be95 in tacopie::utils::thread_pool::run() /home/lexy/code/gdcloud/Libraries/cpp_redis/tacopie/sources/utils/thread_pool.cpp:58 #21 0x7fd695ea2c7f (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xb8c7f) #22 0x7fd696a136b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9) #23 0x7fd69591182c in clone (/lib/x86_64-linux-gnu/libc.so.6+0x10682c) 0x61500005b9d8 is located 88 bytes inside of 480-byte region [0x61500005b980,0x61500005bb60) freed by thread T0 here: #0 0x7fd696cc2b2a in operator delete(void*) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99b2a) #1 0x4fba07 in __gnu_cxx::new_allocator::deallocate(tacopie::tcp_client::read_request*, unsigned long) /usr/include/c++/5/ext/new_allocator.h:110 #2 0x4fba07 in std::allocator_traits >::deallocate(std::allocator&, tacopie::tcp_client::read_request*, unsigned long) /usr/include/c++/5/bits/alloc_traits.h:517 #3 0x4fba07 in std::_Deque_base >::_M_deallocate_node(tacopie::tcp_client::read_request*) /usr/include/c++/5/bits/stl_deque.h:608 #4 0x4fba07 in std::_Deque_base >::_M_destroy_nodes(tacopie::tcp_client::read_request**, tacopie::tcp_client::read_request**) /usr/include/c++/5/bits/stl_deque.h:742 #5 0x4fba07 in std::_Deque_base >::~_Deque_base() /usr/include/c++/5/bits/stl_deque.h:664 #6 0x4fba07 in std::deque >::~deque() /usr/include/c++/5/bits/stl_deque.h:1039 #7 0x4fba07 in std::queue > >::~queue() /usr/include/c++/5/bits/stl_queue.h:96 #8 0x4fba07 in tacopie::tcp_client::~tcp_client() /home/lexy/code/gdcloud/Libraries/cpp_redis/tacopie/sources/network/tcp_client.cpp:37 previously allocated by thread T0 here: #0 0x7fd696cc2532 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99532) #1 0x4ffb01 in __gnu_cxx::new_allocator::allocate(unsigned long, void const*) /usr/include/c++/5/ext/new_allocator.h:104 #2 0x4ffb01 in std::allocator_traits >::allocate(std::allocator&, unsigned long) /usr/include/c++/5/bits/alloc_traits.h:491 #3 0x4ffb01 in std::_Deque_base >::_M_allocate_node() /usr/include/c++/5/bits/stl_deque.h:601 #4 0x4ffb01 in std::_Deque_base >::_M_create_nodes(tacopie::tcp_client::read_request**, tacopie::tcp_client::read_request**) /usr/include/c++/5/bits/stl_deque.h:726 #5 0x4ffb01 in std::_Deque_base >::_M_initialize_map(unsigned long) /usr/include/c++/5/bits/stl_deque.h:700 Thread T1 created by T0 here: #0 0x7fd696c5f253 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x36253) #1 0x7fd695ea2dc2 in std::thread::_M_start_thread(std::shared_ptr, void (*)()) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0xb8dc2) SUMMARY: AddressSanitizer: heap-use-after-free /usr/include/c++/5/functional:1710 std::_Function_base::_Base_manager::_M_clone(std::_Any_data&, std::_Function_base::_Base_manager const&, std::integral_constant) Shadow bytes around the buggy address: 0x0c2a800036e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c2a800036f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c2a80003700: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c2a80003710: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa 0x0c2a80003720: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c2a80003730: fd fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd 0x0c2a80003740: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c2a80003750: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c2a80003760: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa 0x0c2a80003770: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2a80003780: fd fd fd fd fd fd fd fd fd fd fd fd fd fd 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==10780==ABORTING