Skip to content

Instantly share code, notes, and snippets.

@wbbradley
Last active August 31, 2021 02:47
Show Gist options
  • Save wbbradley/851dd362f9564b19bd634504b0465024 to your computer and use it in GitHub Desktop.
Save wbbradley/851dd362f9564b19bd634504b0465024 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <map>
#include <memory>
struct X {
X(int x) : x(x) {}
int x;
};
typedef std::multimap<int, std::shared_ptr<X>> Map;
Map::iterator have_it(std::shared_ptr<X> px) {
std::multimap<int, std::shared_ptr<X>> m;
return m.insert({px->x, px});
}
Map::iterator get_iterator_to_where_val_is_stored(int val) {
auto x = std::make_shared<X>(val);
return have_it(x);
}
int main(int, char *_[]) {
auto itr = get_iterator_to_where_val_is_stored(2);
std::shared_ptr<X> p = itr->second;
return 0;
}
Memcheck, a memory error detector
Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
Command: ./a.out
Parent PID: 78395
Invalid read of size 8
at 0x109810: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2> const&) (in /home/wbbradley/a.out)
by 0x10985E: std::shared_ptr<X>::shared_ptr(std::shared_ptr<X> const&) (in /home/wbbradley/a.out)
by 0x109453: main (in /home/wbbradley/a.out)
Address 0x4dbad08 is 40 bytes inside a block of size 56 free'd
at 0x483CFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10A7CB: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > >::deallocate(std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >*, unsigned long) (in /home/wbbradley/a.out)
by 0x10A54C: std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > > >::deallocate(std::allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > >&, std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >*, unsigned long) (in /home/wbbradley/a.out)
by 0x10A2C2: std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_put_node(std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >*) (in /home/wbbradley/a.out)
by 0x109EF3: std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_drop_node(std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >*) (in /home/wbbradley/a.out)
by 0x109BA9: std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_erase(std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >*) (in /home/wbbradley/a.out)
by 0x1098EB: std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::~_Rb_tree() (in /home/wbbradley/a.out)
by 0x10978B: std::multimap<int, std::shared_ptr<X>, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::~multimap() (in /home/wbbradley/a.out)
by 0x109303: have_it(std::shared_ptr<X>) (in /home/wbbradley/a.out)
by 0x10939E: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Block was alloc'd at
at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AD75: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > >::allocate(unsigned long, void const*) (in /home/wbbradley/a.out)
by 0x10AB4D: std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > > >::allocate(std::allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > >&, unsigned long) (in /home/wbbradley/a.out)
by 0x10A816: std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_get_node() (in /home/wbbradley/a.out)
by 0x10A5CB: std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >* std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_create_node<std::pair<int const, std::shared_ptr<X> > >(std::pair<int const, std::shared_ptr<X> >&&) (in /home/wbbradley/a.out)
by 0x10A43E: std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >* std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_Alloc_node::operator()<std::pair<int const, std::shared_ptr<X> > >(std::pair<int const, std::shared_ptr<X> >&&) const (in /home/wbbradley/a.out)
by 0x10A10B: std::_Rb_tree_iterator<std::pair<int const, std::shared_ptr<X> > > std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_insert_<std::pair<int const, std::shared_ptr<X> >, std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_Alloc_node>(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<int const, std::shared_ptr<X> >&&, std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_Alloc_node&) (in /home/wbbradley/a.out)
by 0x109D2E: std::_Rb_tree_iterator<std::pair<int const, std::shared_ptr<X> > > std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_insert_equal<std::pair<int const, std::shared_ptr<X> > >(std::pair<int const, std::shared_ptr<X> >&&) (in /home/wbbradley/a.out)
by 0x1099CB: std::multimap<int, std::shared_ptr<X>, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::insert(std::pair<int const, std::shared_ptr<X> >&&) (in /home/wbbradley/a.out)
by 0x1092E8: have_it(std::shared_ptr<X>) (in /home/wbbradley/a.out)
by 0x10939E: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Invalid read of size 8
at 0x109AC4: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&) (in /home/wbbradley/a.out)
by 0x109834: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2> const&) (in /home/wbbradley/a.out)
by 0x10985E: std::shared_ptr<X>::shared_ptr(std::shared_ptr<X> const&) (in /home/wbbradley/a.out)
by 0x109453: main (in /home/wbbradley/a.out)
Address 0x4dbad10 is 48 bytes inside a block of size 56 free'd
at 0x483CFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10A7CB: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > >::deallocate(std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >*, unsigned long) (in /home/wbbradley/a.out)
by 0x10A54C: std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > > >::deallocate(std::allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > >&, std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >*, unsigned long) (in /home/wbbradley/a.out)
by 0x10A2C2: std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_put_node(std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >*) (in /home/wbbradley/a.out)
by 0x109EF3: std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_drop_node(std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >*) (in /home/wbbradley/a.out)
by 0x109BA9: std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_erase(std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >*) (in /home/wbbradley/a.out)
by 0x1098EB: std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::~_Rb_tree() (in /home/wbbradley/a.out)
by 0x10978B: std::multimap<int, std::shared_ptr<X>, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::~multimap() (in /home/wbbradley/a.out)
by 0x109303: have_it(std::shared_ptr<X>) (in /home/wbbradley/a.out)
by 0x10939E: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Block was alloc'd at
at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AD75: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > >::allocate(unsigned long, void const*) (in /home/wbbradley/a.out)
by 0x10AB4D: std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > > >::allocate(std::allocator<std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > > >&, unsigned long) (in /home/wbbradley/a.out)
by 0x10A816: std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_get_node() (in /home/wbbradley/a.out)
by 0x10A5CB: std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >* std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_create_node<std::pair<int const, std::shared_ptr<X> > >(std::pair<int const, std::shared_ptr<X> >&&) (in /home/wbbradley/a.out)
by 0x10A43E: std::_Rb_tree_node<std::pair<int const, std::shared_ptr<X> > >* std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_Alloc_node::operator()<std::pair<int const, std::shared_ptr<X> > >(std::pair<int const, std::shared_ptr<X> >&&) const (in /home/wbbradley/a.out)
by 0x10A10B: std::_Rb_tree_iterator<std::pair<int const, std::shared_ptr<X> > > std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_insert_<std::pair<int const, std::shared_ptr<X> >, std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_Alloc_node>(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<int const, std::shared_ptr<X> >&&, std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_Alloc_node&) (in /home/wbbradley/a.out)
by 0x109D2E: std::_Rb_tree_iterator<std::pair<int const, std::shared_ptr<X> > > std::_Rb_tree<int, std::pair<int const, std::shared_ptr<X> >, std::_Select1st<std::pair<int const, std::shared_ptr<X> > >, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::_M_insert_equal<std::pair<int const, std::shared_ptr<X> > >(std::pair<int const, std::shared_ptr<X> >&&) (in /home/wbbradley/a.out)
by 0x1099CB: std::multimap<int, std::shared_ptr<X>, std::less<int>, std::allocator<std::pair<int const, std::shared_ptr<X> > > >::insert(std::pair<int const, std::shared_ptr<X> >&&) (in /home/wbbradley/a.out)
by 0x1092E8: have_it(std::shared_ptr<X>) (in /home/wbbradley/a.out)
by 0x10939E: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Invalid read of size 4
at 0x1095E1: __gnu_cxx::__atomic_add_single(int*, int) (in /home/wbbradley/a.out)
by 0x109675: __gnu_cxx::__atomic_add_dispatch(int*, int) (in /home/wbbradley/a.out)
by 0x109E58: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy() (in /home/wbbradley/a.out)
by 0x109AE8: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&) (in /home/wbbradley/a.out)
by 0x109834: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2> const&) (in /home/wbbradley/a.out)
by 0x10985E: std::shared_ptr<X>::shared_ptr(std::shared_ptr<X> const&) (in /home/wbbradley/a.out)
by 0x109453: main (in /home/wbbradley/a.out)
Address 0x4dbac88 is 8 bytes inside a block of size 24 free'd
at 0x483CFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE87: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::deallocate(std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10AC44: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::deallocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10A947: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::~__allocated_ptr() (in /home/wbbradley/a.out)
by 0x10B063: std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>::_M_destroy() (in /home/wbbradley/a.out)
by 0x109C8B: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x1093B9: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Block was alloc'd at
at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE4E: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) (in /home/wbbradley/a.out)
by 0x10ABD8: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) (in /home/wbbradley/a.out)
by 0x10A8EF: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&) (in /home/wbbradley/a.out)
by 0x10A64F: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<X, std::allocator<X>, int&>(X*&, std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A4B1: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A1CE: std::shared_ptr<X>::shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x109DBE: std::shared_ptr<X> std::allocate_shared<X, std::allocator<X>, int&>(std::allocator<X> const&, int&) (in /home/wbbradley/a.out)
by 0x109A27: std::shared_ptr<X> std::make_shared<X, int&>(int&) (in /home/wbbradley/a.out)
by 0x10937F: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Invalid write of size 4
at 0x1095EC: __gnu_cxx::__atomic_add_single(int*, int) (in /home/wbbradley/a.out)
by 0x109675: __gnu_cxx::__atomic_add_dispatch(int*, int) (in /home/wbbradley/a.out)
by 0x109E58: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy() (in /home/wbbradley/a.out)
by 0x109AE8: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&) (in /home/wbbradley/a.out)
by 0x109834: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2> const&) (in /home/wbbradley/a.out)
by 0x10985E: std::shared_ptr<X>::shared_ptr(std::shared_ptr<X> const&) (in /home/wbbradley/a.out)
by 0x109453: main (in /home/wbbradley/a.out)
Address 0x4dbac88 is 8 bytes inside a block of size 24 free'd
at 0x483CFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE87: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::deallocate(std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10AC44: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::deallocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10A947: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::~__allocated_ptr() (in /home/wbbradley/a.out)
by 0x10B063: std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>::_M_destroy() (in /home/wbbradley/a.out)
by 0x109C8B: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x1093B9: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Block was alloc'd at
at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE4E: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) (in /home/wbbradley/a.out)
by 0x10ABD8: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) (in /home/wbbradley/a.out)
by 0x10A8EF: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&) (in /home/wbbradley/a.out)
by 0x10A64F: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<X, std::allocator<X>, int&>(X*&, std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A4B1: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A1CE: std::shared_ptr<X>::shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x109DBE: std::shared_ptr<X> std::allocate_shared<X, std::allocator<X>, int&>(std::allocator<X> const&, int&) (in /home/wbbradley/a.out)
by 0x109A27: std::shared_ptr<X> std::make_shared<X, int&>(int&) (in /home/wbbradley/a.out)
by 0x10937F: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Invalid read of size 4
at 0x1095B7: __gnu_cxx::__exchange_and_add_single(int*, int) (in /home/wbbradley/a.out)
by 0x109631: __gnu_cxx::__exchange_and_add_dispatch(int*, int) (in /home/wbbradley/a.out)
by 0x109C34: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x109464: main (in /home/wbbradley/a.out)
Address 0x4dbac88 is 8 bytes inside a block of size 24 free'd
at 0x483CFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE87: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::deallocate(std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10AC44: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::deallocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10A947: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::~__allocated_ptr() (in /home/wbbradley/a.out)
by 0x10B063: std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>::_M_destroy() (in /home/wbbradley/a.out)
by 0x109C8B: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x1093B9: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Block was alloc'd at
at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE4E: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) (in /home/wbbradley/a.out)
by 0x10ABD8: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) (in /home/wbbradley/a.out)
by 0x10A8EF: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&) (in /home/wbbradley/a.out)
by 0x10A64F: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<X, std::allocator<X>, int&>(X*&, std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A4B1: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A1CE: std::shared_ptr<X>::shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x109DBE: std::shared_ptr<X> std::allocate_shared<X, std::allocator<X>, int&>(std::allocator<X> const&, int&) (in /home/wbbradley/a.out)
by 0x109A27: std::shared_ptr<X> std::make_shared<X, int&>(int&) (in /home/wbbradley/a.out)
by 0x10937F: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Invalid read of size 4
at 0x1095C0: __gnu_cxx::__exchange_and_add_single(int*, int) (in /home/wbbradley/a.out)
by 0x109631: __gnu_cxx::__exchange_and_add_dispatch(int*, int) (in /home/wbbradley/a.out)
by 0x109C34: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x109464: main (in /home/wbbradley/a.out)
Address 0x4dbac88 is 8 bytes inside a block of size 24 free'd
at 0x483CFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE87: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::deallocate(std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10AC44: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::deallocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10A947: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::~__allocated_ptr() (in /home/wbbradley/a.out)
by 0x10B063: std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>::_M_destroy() (in /home/wbbradley/a.out)
by 0x109C8B: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x1093B9: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Block was alloc'd at
at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE4E: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) (in /home/wbbradley/a.out)
by 0x10ABD8: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) (in /home/wbbradley/a.out)
by 0x10A8EF: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&) (in /home/wbbradley/a.out)
by 0x10A64F: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<X, std::allocator<X>, int&>(X*&, std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A4B1: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A1CE: std::shared_ptr<X>::shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x109DBE: std::shared_ptr<X> std::allocate_shared<X, std::allocator<X>, int&>(std::allocator<X> const&, int&) (in /home/wbbradley/a.out)
by 0x109A27: std::shared_ptr<X> std::make_shared<X, int&>(int&) (in /home/wbbradley/a.out)
by 0x10937F: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Invalid write of size 4
at 0x1095CB: __gnu_cxx::__exchange_and_add_single(int*, int) (in /home/wbbradley/a.out)
by 0x109631: __gnu_cxx::__exchange_and_add_dispatch(int*, int) (in /home/wbbradley/a.out)
by 0x109C34: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x109464: main (in /home/wbbradley/a.out)
Address 0x4dbac88 is 8 bytes inside a block of size 24 free'd
at 0x483CFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE87: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::deallocate(std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10AC44: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::deallocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10A947: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::~__allocated_ptr() (in /home/wbbradley/a.out)
by 0x10B063: std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>::_M_destroy() (in /home/wbbradley/a.out)
by 0x109C8B: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x1093B9: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Block was alloc'd at
at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE4E: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) (in /home/wbbradley/a.out)
by 0x10ABD8: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) (in /home/wbbradley/a.out)
by 0x10A8EF: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&) (in /home/wbbradley/a.out)
by 0x10A64F: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<X, std::allocator<X>, int&>(X*&, std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A4B1: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A1CE: std::shared_ptr<X>::shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x109DBE: std::shared_ptr<X> std::allocate_shared<X, std::allocator<X>, int&>(std::allocator<X> const&, int&) (in /home/wbbradley/a.out)
by 0x109A27: std::shared_ptr<X> std::make_shared<X, int&>(int&) (in /home/wbbradley/a.out)
by 0x10937F: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Invalid read of size 8
at 0x109C43: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x109464: main (in /home/wbbradley/a.out)
Address 0x4dbac80 is 0 bytes inside a block of size 24 free'd
at 0x483CFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE87: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::deallocate(std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10AC44: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::deallocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) (in /home/wbbradley/a.out)
by 0x10A947: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::~__allocated_ptr() (in /home/wbbradley/a.out)
by 0x10B063: std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2>::_M_destroy() (in /home/wbbradley/a.out)
by 0x109C8B: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x1093B9: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Block was alloc'd at
at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x10AE4E: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) (in /home/wbbradley/a.out)
by 0x10ABD8: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) (in /home/wbbradley/a.out)
by 0x10A8EF: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<X, std::allocator<X>, (__gnu_cxx::_Lock_policy)2> >&) (in /home/wbbradley/a.out)
by 0x10A64F: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<X, std::allocator<X>, int&>(X*&, std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A4B1: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x10A1CE: std::shared_ptr<X>::shared_ptr<std::allocator<X>, int&>(std::_Sp_alloc_shared_tag<std::allocator<X> >, int&) (in /home/wbbradley/a.out)
by 0x109DBE: std::shared_ptr<X> std::allocate_shared<X, std::allocator<X>, int&>(std::allocator<X> const&, int&) (in /home/wbbradley/a.out)
by 0x109A27: std::shared_ptr<X> std::make_shared<X, int&>(int&) (in /home/wbbradley/a.out)
by 0x10937F: get_iterator_to_where_val_is_stored(int) (in /home/wbbradley/a.out)
by 0x109430: main (in /home/wbbradley/a.out)
Process terminating with default action of signal 6 (SIGABRT)
at 0x4AA918B: raise (raise.c:51)
by 0x4A88858: abort (abort.c:79)
by 0x4904910: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
by 0x491038B: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
by 0x49103F6: std::terminate() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
by 0x4911154: __cxa_pure_virtual (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
by 0x109C55: std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (in /home/wbbradley/a.out)
by 0x109998: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (in /home/wbbradley/a.out)
by 0x1097AF: std::__shared_ptr<X, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (in /home/wbbradley/a.out)
by 0x1097CF: std::shared_ptr<X>::~shared_ptr() (in /home/wbbradley/a.out)
by 0x109464: main (in /home/wbbradley/a.out)
HEAP SUMMARY:
in use at exit: 0 bytes in 0 blocks
total heap usage: 3 allocs, 3 frees, 72,784 bytes allocated
All heap blocks were freed -- no leaks are possible
For lists of detected and suppressed errors, rerun with: -s
ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 0 from 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment