Opened 6 years ago

Last modified 6 years ago

#12809 new Bugs

crash in boost interprocess cached adaptive pool when using allocate_one method

Reported by: naidu.trk@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.62.0 Severity: Problem
Keywords: boost interprocess cached adaptive pool Cc:

Description

create a segment manager and then create a cached adaptive pool. Allocate an object with allocate_one method. do it many times and we will see a consistent crash in cached_allocator while traversing the multiallocation chain. boost named interprocess mutexes were used to protect the pools. The crash goes away when allocate method is used instead of allocate_one but the allocate method will bypass the cached allocator. A stack trace is pasted here for reference.

Reading symbols from client...done. [New LWP 6334] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `./client'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000000000499663 in boost::interprocess::offset_ptr<boost::intrusive::slist_node<boost::interprocess::offset_ptr<void, long, unsigned long, 0ul> >, long, unsigned long, 0ul>::offset_ptr (ptr=..., this=0x7fff0a022830)

at ../..opensource/boost_1_62_0/include/boost/interprocess/offset_ptr.hpp:270

270 (ipcdetail::offset_ptr_to_offset_from_other(this, &ptr, ptr.internal.m_offset))) (gdb) bt #0 0x0000000000499663 in boost::interprocess::offset_ptr<boost::intrusive::slist_node<boost::interprocess::offset_ptr<void, long, unsigned long, 0ul> >, long, unsigned long, 0ul>::offset_ptr (ptr=..., this=0x7fff0a022830)

at ../..opensource/boost_1_62_0/include/boost/interprocess/offset_ptr.hpp:270

#1 boost::intrusive::slist_node_traits<boost::interprocess::offset_ptr<void, long, unsigned long, 0ul> >::get_next (n=...)

at ../..opensource/boost_1_62_0/include/boost/intrusive/detail/slist_node.hpp:53

#2 0x0000000000495b98 in boost::intrusive::slist_iterator<boost::intrusive::bhtraits<boost::intrusive::slist_base_hook<boost::intrusive::void_pointer<boost::interprocess::offset_ptr<void, long, unsigned long, 0ul> >, boost::intrusive::link_mode<(boost::intrusive::link_mode_type)0>, void>, boost::intrusive::slist_node_traits<boost::interprocess::offset_ptr<void, long, unsigned long, 0ul> >, (boost::intrusive::link_mode_type)0, boost::intrusive::dft_tag, 2u>, false>::operator++ (this=0x7fff0a0228c0)

at ../..opensource/boost_1_62_0/include/boost/intrusive/detail/slist_iterator.hpp:83

#3 0x000000000049ecd5 in boost::intrusive::iterator_distance<boost::intrusive::slist_iterator<boost::intrusive::bhtraits<boost::intrusive::slist_base_hook<boost::intrusive::void_pointer<boost::interprocess::offset_ptr<void, long, unsigned long, 0ul> >, boost::intrusive::link_mode<(boost::intrusive::link_mode_type)0>, void>, boost::intrusive::slist_node_traits<boost::interprocess::offset_ptr<void, long, unsigned long, 0ul> >, (boost::intrusive::link_mode_type)0, boost::intrusive::dft_tag, 2u>, false> > (first=..., last=...)

at ../..opensource/boost_1_62_0/include/boost/intrusive/detail/iterator.hpp:131

#4 0x000000000049ada1 in boost::intrusive::slist_impl<boost::intrusive::bhtraits<boost::intrusive::slist_base_hook<boost::intrusive::void_pointer<boost::interprocess::offset_ptr<void, long, unsigned long, 0ul> >, boost::intrusive::link_mode<(boost::intrusive::link_mode_type)0>, void>, boost::intrusive::slist_node_traits<boost::interprocess::offset_ptr<void, long, unsigned long, 0ul> >, (boost::intrusive::link_mode_type)0, boost::intrusive::dft_tag, 2u>, unsigned long, 7ul, void>::incorporate_after (

this=0x6de778 <ranzure::platform::bufferManager::getInstance()::instance+184>, prev_pos=..., f=..., before_l=..., n=3) at ../..opensource/boost_1_62_0/include/boost/intrusive/slist.hpp:1906

#5 0x0000000000496d8b in boost::container::container_detail::basic_multiallocation_chain<boost::interprocess::offset_ptr<void, long, unsigned long, 0ul> >::incorporate_after (this=0x6de778 <ranzure::platform::bufferManager::getInstance()::instance+184>, after_this=..., b=...,

before_e=..., n=3) at ../..opensource/boost_1_62_0/include/boost/container/detail/multiallocation_chain.hpp:164

#6 0x0000000000495873 in boost::container::container_detail::private_adaptive_node_pool_impl<boost::interprocess::segment_manager_base<boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long, unsigned long, 0ul>, 0ul> >, 6u>::allocate_nodes (this=0x7f276a3505c8, n=64, chain=...) at ../..opensource/boost_1_62_0/include/boost/container/detail/adaptive_node_pool_impl.hpp:462 #7 0x0000000000492512 in boost::interprocess::ipcdetail::shared_pool_impl<boost::interprocess::ipcdetail::private_adaptive_node_pool<boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long, unsigned long, 0ul>, 0ul>, boost::interprocess::iset_index>, 1088ul, 512ul, 1024ul, (unsigned char)10> >::allocate_nodes (this=0x7f276a3505c8,

n=64, chain=...) at ../..opensource/boost_1_62_0/include/boost/interprocess/allocators/detail/allocator_common.hpp:762

#8 0x000000000048f22b in boost::interprocess::ipcdetail::cache_impl<boost::interprocess::ipcdetail::shared_adaptive_node_pool<boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long, unsigned long, 0ul>, 0ul>, boost::interprocess::iset_index>, 1088ul, 512ul, 1024ul, (unsigned char)10> >::cached_allocation (

this=0x6de770 <ranzure::platform::bufferManager::getInstance()::instance+176>) at ../..opensource/boost_1_62_0/include/boost/interprocess/allocators/detail/allocator_common.hpp:199

#9 0x000000000048ccb1 in boost::interprocess::ipcdetail::cached_allocator_impl<ranzure::platform::bufferManager::oneKBuffer, boost::interprocess::ipcdetail::shared_adaptive_node_pool<boost::interprocess::segment_manager<char, boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family, boost::interprocess::offset_ptr<void, long, unsigned long, 0ul>, 0ul>, boost::interprocess::iset_index>, 1088ul, 512ul, 1024ul, (unsigned char)10>, 2u>::allocate_one (this=0x6de770 <ranzure::platform::bufferManager::getInstance()::instance+176>)

at ../..opensource/boost_1_62_0/include/boost/interprocess/allocators/detail/allocator_common.hpp:644

#10 0x00000000004876b4 in ranzure::platform::bufferManager::get1KBuffer ( ---Type <return> to continue, or q <return> to quit---

this=0x6de6c0 <ranzure::platform::bufferManager::getInstance()::instance>) at buffmanager.cc:193

#11 0x000000000047e7af in main (argc=1, argv=0x7fff0a023158) at client.cc:67

Change History (1)

Note: See TracTickets for help on using tickets.