Skip to content
This repository was archived by the owner on Oct 31, 2019. It is now read-only.
This repository was archived by the owner on Oct 31, 2019. It is now read-only.

Address Sanitizer reports an issue while exiting Duke #51

@gchatelet

Description

@gchatelet
==26419==ERROR: AddressSanitizer: heap-use-after-free on address 0x60e00000df98 at pc 0x82c9db bp 0x7ffff7926fd0 sp 0x7ffff7926fc8
READ of size 8 at 0x60e00000df98 thread T0
    #0 0x82c9da in std::_Head_base<3ul, unsigned long, false>::_Head_base(unsigned long const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/tuple:134
    #1 0x82c531 in std::_Tuple_impl<3ul, unsigned long>::_Tuple_impl(unsigned long const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/tuple:255
    #2 0x82c051 in std::_Tuple_impl<2ul, unsigned long, unsigned long>::_Tuple_impl(unsigned long const&, unsigned long const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/tuple:255
    #3 0x82baf8 in std::_Tuple_impl<1ul, unsigned long, unsigned long, unsigned long>::_Tuple_impl(unsigned long const&, unsigned long const&, unsigned long const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/tuple:255
    #4 0x82b777 in std::_Tuple_impl<0ul, unsigned long, unsigned long, unsigned long, unsigned long>::_Tuple_impl(unsigned long const&, unsigned long const&, unsigned long const&, unsigned long const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/tuple:255
    #5 0x82b3a1 in std::tuple<unsigned long, unsigned long, unsigned long, unsigned long>::tuple(unsigned long const&, unsigned long const&, unsigned long const&, unsigned long const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/tuple:398
    #6 0x82afa0 in std::tuple<std::__decay_and_strip<unsigned long const&>::__type, std::__decay_and_strip<unsigned long const&>::__type, std::__decay_and_strip<unsigned long const&>::__type, std::__decay_and_strip<unsigned long const&>::__type> std::make_tuple<unsigned long const&, unsigned long const&, unsigned long const&, unsigned long const&>(unsigned long const&, unsigned long const&, unsigned long const&, unsigned long const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/tuple:862
    #7 0x82ac4f in PackedFrameDescription::asTuple() const /home/clitte/git/duke/src/duke/imageio/PackedFrameDescription.hpp:16
    #8 0x82a7d6 in PackedFrameDescription::operator<(PackedFrameDescription const&) const /home/clitte/git/duke/src/duke/imageio/PackedFrameDescription.hpp:20
    #9 0x81c5d6 in std::less<PackedFrameDescription>::operator()(PackedFrameDescription const&, PackedFrameDescription const&) const /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_function.h:235
    #10 0x82fd62 in std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::_M_lower_bound(std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >*, std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >*, PackedFrameDescription const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:1141
    #11 0x82f98d in std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::lower_bound(PackedFrameDescription const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:879
    #12 0x81bc84 in std::map<PackedFrameDescription, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::lower_bound(PackedFrameDescription const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_map.h:864
    #13 0x8142e3 in std::map<PackedFrameDescription, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::operator[](PackedFrameDescription&&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_map.h:481
    #14 0x813da6 in pool::Pool<duke::TexturePoolPolicy>::recycle(duke::Texture*) /home/clitte/git/duke/src/duke/engine/cache/Pool.hpp:41
    #15 0x83449f in void std::_Mem_fn<void (pool::Pool<duke::TexturePoolPolicy>::*)(duke::Texture*)>::operator()<duke::Texture*, void>(pool::Pool<duke::TexturePoolPolicy>*, duke::Texture*&&) const /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/functional:601
    #16 0x8337fc in void std::_Bind<std::_Mem_fn<void (pool::Pool<duke::TexturePoolPolicy>::*)(duke::Texture*)> (pool::Pool<duke::TexturePoolPolicy>*, std::_Placeholder<1>)>::__call<void, duke::Texture*&&, 0ul, 1ul>(std::tuple<duke::Texture*&&>&&, std::_Index_tuple<0ul, 1ul>) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/functional:1295
    #17 0x83332a in void std::_Bind<std::_Mem_fn<void (pool::Pool<duke::TexturePoolPolicy>::*)(duke::Texture*)> (pool::Pool<duke::TexturePoolPolicy>*, std::_Placeholder<1>)>::operator()<duke::Texture*, void>(duke::Texture*&&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/functional:1353
    #18 0x831eeb in std::_Function_handler<void (duke::Texture*), std::_Bind<std::_Mem_fn<void (pool::Pool<duke::TexturePoolPolicy>::*)(duke::Texture*)> (pool::Pool<duke::TexturePoolPolicy>*, std::_Placeholder<1>)> >::_M_invoke(std::_Any_data const&, duke::Texture*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/functional:2071
    #19 0x83939a in std::function<void (duke::Texture*)>::operator()(duke::Texture*) const /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/functional:2464
    #20 0x83b74b in std::_Sp_counted_deleter<duke::Texture*, std::function<void (duke::Texture*)>, std::allocator<int>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/shared_ptr_base.h:347
    #21 0x5bd12d in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/shared_ptr_base.h:144
    #22 0x5bcf22 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/shared_ptr_base.h:546
    #23 0x5d0c0f in std::__shared_ptr<duke::Texture, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/shared_ptr_base.h:781
    #24 0x5d0a88 in std::shared_ptr<duke::Texture>::~shared_ptr() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/shared_ptr.h:93
    #25 0x5d0795 in void std::_Destroy<std::shared_ptr<duke::Texture> >(std::shared_ptr<duke::Texture>*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_construct.h:93
    #26 0x5d05c7 in void std::_Destroy_aux<false>::__destroy<std::shared_ptr<duke::Texture>*>(std::shared_ptr<duke::Texture>*, std::shared_ptr<duke::Texture>*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_construct.h:103:6
    #27 0x5d0371 in void std::_Destroy<std::shared_ptr<duke::Texture>*>(std::shared_ptr<duke::Texture>*, std::shared_ptr<duke::Texture>*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_construct.h:126
    #28 0x5d0126 in void std::_Destroy<std::shared_ptr<duke::Texture>*, std::shared_ptr<duke::Texture> >(std::shared_ptr<duke::Texture>*, std::shared_ptr<duke::Texture>*, std::allocator<std::shared_ptr<duke::Texture> >&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_construct.h:151
    #29 0x5cfead in std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > >::_M_destroy_data_aux(std::_Deque_iterator<std::shared_ptr<duke::Texture>, std::shared_ptr<duke::Texture>&, std::shared_ptr<duke::Texture>*>, std::_Deque_iterator<std::shared_ptr<duke::Texture>, std::shared_ptr<duke::Texture>&, std::shared_ptr<duke::Texture>*>) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/deque.tcc:817:3
    #30 0x5ccdb3 in std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > >::_M_destroy_data(std::_Deque_iterator<std::shared_ptr<duke::Texture>, std::shared_ptr<duke::Texture>&, std::shared_ptr<duke::Texture>*>, std::_Deque_iterator<std::shared_ptr<duke::Texture>, std::shared_ptr<duke::Texture>&, std::shared_ptr<duke::Texture>*>, std::allocator<std::shared_ptr<duke::Texture> > const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_deque.h:1853
    #31 0x5cca3d in std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > >::~deque() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_deque.h:918
    #32 0x5cc815 in std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > >::~stack() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_stack.h:96
    #33 0x5cc69f in std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >::~pair() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_pair.h:96
    #34 0x5cc51f in std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >::~_Rb_tree_node() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:131
    #35 0x5cbefe in void __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::destroy<std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >(std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/ext/new_allocator.h:124
    #36 0x5cbb3e in std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::_M_destroy_node(std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:421
    #37 0x5caf25 in std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::_M_erase(std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:1127
    #38 0x5cab1f in std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::~_Rb_tree() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:671
    #39 0x5ca945 in std::map<PackedFrameDescription, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::~map() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_map.h:96
    #40 0x5b83cf in pool::Pool<duke::TexturePoolPolicy>::~Pool() /home/clitte/git/duke/src/duke/engine/cache/Pool.hpp:25
    #41 0x5b7f2d in duke::LoadedTextureCache::~LoadedTextureCache() /home/clitte/git/duke/src/duke/engine/cache/LoadedTextureCache.hpp:16
    #42 0x5b4acf in duke::Player::~Player() /home/clitte/git/duke/src/duke/engine/Player.hpp:12
    #43 0x5b4150 in duke::DukeMainWindow::~DukeMainWindow() /home/clitte/git/duke/src/duke/engine/DukeMainWindow.hpp:16
    #44 0x5b3207 in duke::DukeApplication::~DukeApplication() /home/clitte/git/duke/src/duke/engine/DukeApplication.hpp:10
    #45 0x5b06dc in main /home/clitte/git/duke/src/duke/main.cpp:40
    #46 0x7f0ecdc48b04 in __libc_start_main (/usr/lib/libc.so.6+0x21b04)
    #47 0x55a15c in _start (/home/clitte/git/duke/build/src/duke/duke+0x55a15c)

0x60e00000df98 is located 56 bytes inside of 152-byte region [0x60e00000df60,0x60e00000dff8)
freed by thread T0 here:
    #0 0x5449f9 in operator delete(void*) (/home/clitte/git/duke/build/src/duke/duke+0x5449f9)
    #1 0x5cc377 in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::deallocate(std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >*, unsigned long) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/ext/new_allocator.h:110
    #2 0x5cc11b in std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::_M_put_node(std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:374
    #3 0x5cbb70 in std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::_M_destroy_node(std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:422
    #4 0x5caf25 in std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::_M_erase(std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:1127
    #5 0x5cab1f in std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::~_Rb_tree() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:671
    #6 0x5ca945 in std::map<PackedFrameDescription, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::~map() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_map.h:96
    #7 0x5b83cf in pool::Pool<duke::TexturePoolPolicy>::~Pool() /home/clitte/git/duke/src/duke/engine/cache/Pool.hpp:25
    #8 0x5b7f2d in duke::LoadedTextureCache::~LoadedTextureCache() /home/clitte/git/duke/src/duke/engine/cache/LoadedTextureCache.hpp:16
    #9 0x5b4acf in duke::Player::~Player() /home/clitte/git/duke/src/duke/engine/Player.hpp:12
    #10 0x5b4150 in duke::DukeMainWindow::~DukeMainWindow() /home/clitte/git/duke/src/duke/engine/DukeMainWindow.hpp:16
    #11 0x5b3207 in duke::DukeApplication::~DukeApplication() /home/clitte/git/duke/src/duke/engine/DukeApplication.hpp:10
    #12 0x5b06dc in main /home/clitte/git/duke/src/duke/main.cpp:40
    #13 0x7f0ecdc48b04 in __libc_start_main (/usr/lib/libc.so.6+0x21b04)

previously allocated by thread T0 here:
    #0 0x5446f9 in operator new(unsigned long) (/home/clitte/git/duke/build/src/duke/duke+0x5446f9)
    #1 0x82a427 in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::allocate(unsigned long, void const*) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/ext/new_allocator.h:104
    #2 0x822e3c in std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::_M_get_node() /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:370
    #3 0x83f68f in std::_Rb_tree_node<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >* std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::_M_create_node<std::piecewise_construct_t const&, std::tuple<PackedFrameDescription const&>, std::tuple<> >(std::piecewise_construct_t const&, std::tuple<PackedFrameDescription const&>&&, std::tuple<>&&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:403
    #4 0x83e426 in std::_Rb_tree_iterator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > std::_Rb_tree<PackedFrameDescription, std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > >, std::_Select1st<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<PackedFrameDescription const&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > >, std::piecewise_construct_t const&, std::tuple<PackedFrameDescription const&>&&, std::tuple<>&&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_tree.h:1669
    #5 0x811725 in std::map<PackedFrameDescription, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > >, std::less<PackedFrameDescription>, std::allocator<std::pair<PackedFrameDescription const, std::stack<std::shared_ptr<duke::Texture>, std::deque<std::shared_ptr<duke::Texture>, std::allocator<std::shared_ptr<duke::Texture> > > > > > >::operator[](PackedFrameDescription const&) /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_map.h:465
    #6 0x80273d in pool::Pool<duke::TexturePoolPolicy>::get(PackedFrameDescription const&) /home/clitte/git/duke/src/duke/engine/cache/Pool.hpp:31
    #7 0x7faf94 in duke::LoadedTextureCache::prepare(unsigned long, duke::IterationMode) /home/clitte/git/duke/src/duke/engine/cache/LoadedTextureCache.cpp:39
    #8 0x7821e5 in duke::DukeMainWindow::run() /home/clitte/git/duke/src/duke/engine/DukeMainWindow.cpp:226
    #9 0x6cd7cf in duke::DukeApplication::run() /home/clitte/git/duke/src/duke/engine/DukeApplication.cpp:140
    #10 0x5b0668 in main /home/clitte/git/duke/src/duke/main.cpp:38
    #11 0x7f0ecdc48b04 in __libc_start_main (/usr/lib/libc.so.6+0x21b04)

SUMMARY: AddressSanitizer: heap-use-after-free /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/tuple:134 std::_Head_base<3ul, unsigned long, false>::_Head_base(unsigned long const&)
Shadow bytes around the buggy address:
  0x0c1c7fff9ba0: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa
  0x0c1c7fff9bb0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c1c7fff9bc0: 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa
  0x0c1c7fff9bd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c1c7fff9be0: 00 00 00 00 fa fa fa fa fa fa fa fa fd fd fd fd
=>0x0c1c7fff9bf0: fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fa
  0x0c1c7fff9c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c1c7fff9c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c1c7fff9c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c1c7fff9c30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c1c7fff9c40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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
  ASan internal:         fe

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions