Subject: [Boost-bugs] [Boost C++ Libraries] #12188: Valgrind reports invalid delete after using boost::asio::ip::tcp::resolver.resolve
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-05-10 13:34:06
#12188: Valgrind reports invalid delete after using
boost::asio::ip::tcp::resolver.resolve
-----------------------------------------------+---------------------------
Reporter: Mateusz Wójcik <mateusz.wojcik@â¦> | Owner:
Type: Bugs | chris_kohlhoff
Milestone: To Be Determined | Status: new
Version: Boost 1.60.0 | Component: asio
Keywords: asio valgrind resolver | Severity: Problem
-----------------------------------------------+---------------------------
OS:
Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29) x86_64 GNU/Linux
COMPILER:
gcc version 4.9.2 (Debian 4.9.2-10)
SOURCE:
{{{
#include <boost/asio.hpp>
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();
}
}}}
COMMAND:
{{{
gcc main.cpp -lstdc++ -pthread -lboost_system
valgrind ./a.out
}}}
OUTPUT:
{{{
==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)
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12188> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC