c++ - unordered_map of maps insert crash -


    ntdll.dll!rtlreportcriticalfailure()   unknown     ntdll.dll!rtlpreportheapfailure()  unknown     ntdll.dll!rtlpheaphandleerror()    unknown     ntdll.dll!rtlplogheapfailure() unknown     ntdll.dll!rtlpallocateheap()   unknown     ntdll.dll!rtlallocateheap()    unknown     ntdll.dll!rtldebugallocateheap()   unknown     ntdll.dll!string "enabling heap debug options\n"() unknown     ntdll.dll!rtlallocateheap()    unknown >   msvcr120d.dll!_heap_alloc_base()   unknown     msvcr120d.dll!_free_dbg_nolock()   unknown     msvcr120d.dll!_nh_malloc_dbg() unknown     msvcr120d.dll!_nh_malloc_dbg() unknown     msvcr120d.dll!malloc() unknown     msvcr120d.dll!operator new(unsigned __int64)    unknown     apitester.exe!snap::external_api::price_reference_impl::on_item_changed(const unsigned int mkt_id, const unsigned int prod_id, const short field_id, const __int64 value) line 94   c++     apitester.exe!snap::external_api::price_reference_impl::initialize(std::vector<snap::price::field_id_def_t,std::allocator<snap::price::field_id_def_t> > & field_defs) line 62  c++     apitester.exe!snap::external_api::connection::download_price::__l5::<lambda>() line 78  c++     apitester.exe!boost::_bi::list0::operator()<void <lambda>(void),boost::_bi::list3<boost::system::error_code const & __ptr64,unsigned int const & __ptr64,snap::price::snpricebook & __ptr64> >(boost::_bi::type<void> __formal, snap::external_api::connection::download_price::__l5::void <lambda>(void) & f, boost::_bi::list3<boost::system::error_code const &,unsigned int const &,snap::price::snpricebook &> & __formal, int __formal) line 193  c++     apitester.exe!boost::_bi::bind_t<void,void <lambda>(void),boost::_bi::list0>::operator()<boost::system::error_code const ,unsigned int const ,snap::price::snpricebook>(const boost::system::error_code & a1, const unsigned int & a2, snap::price::snpricebook & a3) line 117  c++     apitester.exe!boost::detail::function::void_function_obj_invoker3<boost::_bi::bind_t<void,void <lambda>(void),boost::_bi::list0>,void,boost::system::error_code const & __ptr64,unsigned int const & __ptr64,snap::price::snpricebook & __ptr64>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const boost::system::error_code & a0, const unsigned int & a1, snap::price::snpricebook & a2) line 154    c++ 

i above call stack when crash occurs in static lib. relevant code follows.

auto mkt_map_it = _depths.find(mkt_id); if (mkt_map_it == _depths.end()) {     _depths.insert(std::make_pair(mkt_id, std::unordered_map<uint32_t, depth*>()));     mkt_map_it = _depths.find(mkt_id); }  //wtf going on?  auto & map = mkt_map_it->second; auto prod_it = map.find(prod_id); if (prod_it == map.end()) {     //the crash happens on following line.      //the number of items in map variable when happens (1,2,10, etc)     map.insert(std::make_pair(prod_id, new depth()));     prod_it = map.find(prod_id); } 

this code inside function called on , on again different values market_id , prod_id. signature of map below

std::unordered_map < uint32_t, std::unordered_map<uint32_t, depth* > > _depths;   

what going on , how fix this?


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -