Boost C++ Libraries: Ticket #12188: Valgrind reports invalid delete after using boost::asio::ip::tcp::resolver.resolve https://svn.boost.org/trac10/ticket/12188 <p> OS: </p> <p> Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29) x86_64 GNU/Linux </p> <p> COMPILER: </p> <p> gcc version 4.9.2 (Debian 4.9.2-10) </p> <p> SOURCE: </p> <pre class="wiki">#include &lt;boost/asio.hpp&gt; int main() { boost::asio::io_service queue; boost::asio::ip::tcp::resolver resolver( queue ); boost::asio::ip::tcp::resolver::query query( "google.com", "" ); resolver.resolve( query ); queue.run(); } </pre><p> COMMAND: </p> <pre class="wiki">gcc main.cpp -lstdc++ -pthread -lboost_system valgrind ./a.out </pre><p> OUTPUT: </p> <pre class="wiki">==20844== Memcheck, a memory error detector ==20844== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==20844== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info ==20844== Command: ./a.out ==20844== ==20844== Invalid free() / delete / delete[] / realloc() ==20844== at 0x4C29E90: free (vg_replace_malloc.c:473) ==20844== by 0x58C249B: __libc_freeres (in /lib/x86_64-linux-gnu/libc-2.19.so) ==20844== by 0x4A236CC: _vgnU_freeres (vg_preloaded.c:63) ==20844== by 0x57ADAEA: __run_exit_handlers (exit.c:97) ==20844== by 0x57ADB74: exit (exit.c:104) ==20844== by 0x5797B4B: (below main) (libc-start.c:321) ==20844== Address 0x5b1b2d0 is 0 bytes inside data symbol "noai6ai_cached" ==20844== ==20844== ==20844== HEAP SUMMARY: ==20844== in use at exit: 0 bytes in 0 blocks ==20844== total heap usage: 79 allocs, 80 frees, 11,451 bytes allocated ==20844== ==20844== All heap blocks were freed -- no leaks are possible ==20844== ==20844== For counts of detected and suppressed errors, rerun with: -v ==20844== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12188 Trac 1.4.3