id summary reporter owner description type status milestone component version severity resolution keywords cc 10696 boost::container::flat_map copy constructor appears to leak dave@… Ion Gaztañaga "The following sandbox.cpp program: {{{ #include int main(int argc, char** argv) { boost::container::flat_map myMap; boost::container::flat_map myCopiedMap(myMap); return 0; } }}} causes valgrind 3.9.0 to produce the following: {{{ $ valgrind --tool=memcheck --leak-check=full --show-reachable=no --undef-value-errors=no --track-origins=no --child-silent-after-fork=yes --trace-children=no ./sandbox ==12648== Memcheck, a memory error detector ==12648== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==12648== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info ==12648== Command: ./sandbox ==12648== ==12648== ==12648== HEAP SUMMARY: ==12648== in use at exit: 3,287 bytes in 86 blocks ==12648== total heap usage: 122 allocs, 36 frees, 56,978 bytes allocated ==12648== ==12648== 0 bytes in 1 blocks are definitely lost in loss record 1 of 86 ==12648== at 0x4C27965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==12648== by 0x40410F: __gnu_cxx::new_allocator >::allocate(unsigned long, void const*) (new_allocator.h:104) ==12648== by 0x40400B: boost::container::container_detail::allocator_version_traits >, 1u>::allocation_command(std::allocator >&, int, unsigned long, unsigned long, unsigned long&, boost::container::container_detail::pair* const&) (allocator_version_traits.hpp:144) ==12648== by 0x403F0D: boost::container::container_detail::vector_alloc_holder >, boost::container::container_detail::integral_constant >::allocation_command(int, unsigned long, unsigned long, unsigned long&, boost::container::container_detail::pair* const&) (vector.hpp:395) ==12648== by 0x403D72: boost::container::container_detail::vector_alloc_holder >, boost::container::container_detail::integral_constant >::vector_alloc_holder > const&>(std::allocator > const&, unsigned long) (vector.hpp:350) ==12648== by 0x403BF2: boost::container::vector, std::allocator > >::vector(boost::container::vector, std::allocator > > const&) (vector.hpp:732) ==12648== by 0x403B34: boost::container::container_detail::flat_tree, boost::container::container_detail::select1st >, std::less, std::allocator > >::Data::Data(boost::container::container_detail::flat_tree, boost::container::container_detail::select1st >, std::less, std::allocator > >::Data const&) (flat_tree.hpp:119) ==12648== by 0x403A42: boost::container::container_detail::flat_tree, boost::container::container_detail::select1st >, std::less, std::allocator > >::flat_tree(boost::container::container_detail::flat_tree, boost::container::container_detail::select1st >, std::less, std::allocator > > const&) (flat_tree.hpp:207) ==12648== by 0x40399A: boost::container::flat_map, std::allocator > >::flat_map(boost::container::flat_map, std::allocator > > const&) (flat_map.hpp:209) ==12648== by 0x4037BE: main (sandbox.cpp:6) ==12648== ==12648== LEAK SUMMARY: ==12648== definitely lost: 0 bytes in 1 blocks ==12648== indirectly lost: 0 bytes in 0 blocks ==12648== possibly lost: 0 bytes in 0 blocks ==12648== still reachable: 3,287 bytes in 85 blocks ==12648== suppressed: 0 bytes in 0 blocks ==12648== Reachable blocks (those to which a pointer was found) are not shown. ==12648== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==12648== ==12648== For counts of detected and suppressed errors, rerun with: -v ==12648== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) }}}" Bugs closed To Be Determined container Boost 1.54.0 Problem fixed