Boost C++ Libraries: Ticket #12809: crash in boost interprocess cached adaptive pool when using allocate_one method https://svn.boost.org/trac10/ticket/12809 <p> 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. </p> <p> 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. <a class="missing ticket">#0</a> 0x0000000000499663 in boost::interprocess::offset_ptr&lt;boost::intrusive::slist_node&lt;boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt; &gt;, long, unsigned long, 0ul&gt;::offset_ptr (ptr=..., this=0x7fff0a022830) </p> <blockquote> <p> at ../..<em>opensource/boost_1_62_0/include/boost/interprocess/offset_ptr.hpp:270 </em></p> </blockquote> <p> 270 (ipcdetail::offset_ptr_to_offset_from_other(this, &amp;ptr, ptr.internal.m_offset))) (gdb) bt <a class="missing ticket">#0</a> 0x0000000000499663 in boost::interprocess::offset_ptr&lt;boost::intrusive::slist_node&lt;boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt; &gt;, long, unsigned long, 0ul&gt;::offset_ptr (ptr=..., this=0x7fff0a022830) </p> <blockquote> <p> at ../..<em>opensource/boost_1_62_0/include/boost/interprocess/offset_ptr.hpp:270 </em></p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1" title="#1: Bugs: boost.build causes ftjam to segfault (closed: Wont Fix)">#1</a> boost::intrusive::slist_node_traits&lt;boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt; &gt;::get_next (n=...) </p> <blockquote> <p> at ../..<em>opensource/boost_1_62_0/include/boost/intrusive/detail/slist_node.hpp:53 </em></p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2" title="#2: Bugs: list::size should be const (closed: fixed)">#2</a> 0x0000000000495b98 in boost::intrusive::slist_iterator&lt;boost::intrusive::bhtraits&lt;boost::intrusive::slist_base_hook&lt;boost::intrusive::void_pointer&lt;boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt; &gt;, boost::intrusive::link_mode&lt;(boost::intrusive::link_mode_type)0&gt;, void&gt;, boost::intrusive::slist_node_traits&lt;boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt; &gt;, (boost::intrusive::link_mode_type)0, boost::intrusive::dft_tag, 2u&gt;, false&gt;::operator++ (this=0x7fff0a0228c0) </p> <blockquote> <p> at ../..<em>opensource/boost_1_62_0/include/boost/intrusive/detail/slist_iterator.hpp:83 </em></p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3" title="#3: Bugs: automatic conversion and overload proble (closed: fixed)">#3</a> 0x000000000049ecd5 in boost::intrusive::iterator_distance&lt;boost::intrusive::slist_iterator&lt;boost::intrusive::bhtraits&lt;boost::intrusive::slist_base_hook&lt;boost::intrusive::void_pointer&lt;boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt; &gt;, boost::intrusive::link_mode&lt;(boost::intrusive::link_mode_type)0&gt;, void&gt;, boost::intrusive::slist_node_traits&lt;boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt; &gt;, (boost::intrusive::link_mode_type)0, boost::intrusive::dft_tag, 2u&gt;, false&gt; &gt; (first=..., last=...) </p> <blockquote> <p> at ../..<em>opensource/boost_1_62_0/include/boost/intrusive/detail/iterator.hpp:131 </em></p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4" title="#4: Bugs: any_ptr in any library documentation? (closed: Fixed)">#4</a> 0x000000000049ada1 in boost::intrusive::slist_impl&lt;boost::intrusive::bhtraits&lt;boost::intrusive::slist_base_hook&lt;boost::intrusive::void_pointer&lt;boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt; &gt;, boost::intrusive::link_mode&lt;(boost::intrusive::link_mode_type)0&gt;, void&gt;, boost::intrusive::slist_node_traits&lt;boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt; &gt;, (boost::intrusive::link_mode_type)0, boost::intrusive::dft_tag, 2u&gt;, unsigned long, 7ul, void&gt;::incorporate_after ( </p> <blockquote> <p> this=0x6de778 &lt;ranzure::platform::bufferManager::getInstance()::instance+184&gt;, prev_pos=..., f=..., before_l=..., n=3) at ../..<em>opensource/boost_1_62_0/include/boost/intrusive/slist.hpp:1906 </em></p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5" title="#5: Bugs: shared_ptr and self-owning objects (closed: Fixed)">#5</a> 0x0000000000496d8b in boost::container::container_detail::basic_multiallocation_chain&lt;boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt; &gt;::incorporate_after (this=0x6de778 &lt;ranzure::platform::bufferManager::getInstance()::instance+184&gt;, after_this=..., b=..., </p> <blockquote> <p> before_e=..., n=3) at ../..<em>opensource/boost_1_62_0/include/boost/container/detail/multiallocation_chain.hpp:164 </em></p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6" title="#6: Bugs: tie in utility.hpp and tuple.hpp clash. (closed: Duplicate)">#6</a> 0x0000000000495873 in boost::container::container_detail::private_adaptive_node_pool_impl&lt;boost::interprocess::segment_manager_base&lt;boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt;, 0ul&gt; &gt;, 6u&gt;::allocate_nodes (this=0x7f276a3505c8, n=64, chain=...) at ../..<em>opensource/boost_1_62_0/include/boost/container/detail/adaptive_node_pool_impl.hpp:462 <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7" title="#7: Bugs: g++ 2.96 requires NO_STRINGSTREAM (closed: Fixed)">#7</a> 0x0000000000492512 in boost::interprocess::ipcdetail::shared_pool_impl&lt;boost::interprocess::ipcdetail::private_adaptive_node_pool&lt;boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt;, 0ul&gt;, boost::interprocess::iset_index&gt;, 1088ul, 512ul, 1024ul, (unsigned char)10&gt; &gt;::allocate_nodes (this=0x7f276a3505c8, </em></p> <blockquote> <p> n=64, chain=...) at ../..<em>opensource/boost_1_62_0/include/boost/interprocess/allocators/detail/allocator_common.hpp:762 </em></p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8" title="#8: Bugs: prop in undirected graph + out_edges (closed: Works For Me)">#8</a> 0x000000000048f22b in boost::interprocess::ipcdetail::cache_impl&lt;boost::interprocess::ipcdetail::shared_adaptive_node_pool&lt;boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt;, 0ul&gt;, boost::interprocess::iset_index&gt;, 1088ul, 512ul, 1024ul, (unsigned char)10&gt; &gt;::cached_allocation ( </p> <blockquote> <p> this=0x6de770 &lt;ranzure::platform::bufferManager::getInstance()::instance+176&gt;) at ../..<em>opensource/boost_1_62_0/include/boost/interprocess/allocators/detail/allocator_common.hpp:199 </em></p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9" title="#9: Bugs: config_info ambiguity error (closed: Invalid)">#9</a> 0x000000000048ccb1 in boost::interprocess::ipcdetail::cached_allocator_impl&lt;ranzure::platform::bufferManager::oneKBuffer, boost::interprocess::ipcdetail::shared_adaptive_node_pool&lt;boost::interprocess::segment_manager&lt;char, boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family, boost::interprocess::offset_ptr&lt;void, long, unsigned long, 0ul&gt;, 0ul&gt;, boost::interprocess::iset_index&gt;, 1088ul, 512ul, 1024ul, (unsigned char)10&gt;, 2u&gt;::allocate_one (this=0x6de770 &lt;ranzure::platform::bufferManager::getInstance()::instance+176&gt;) </p> <blockquote> <p> at ../..<em>opensource/boost_1_62_0/include/boost/interprocess/allocators/detail/allocator_common.hpp:644 </em></p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/10" title="#10: Bugs: allyourbase.jam file is bad. (closed: Out of Date)">#10</a> 0x00000000004876b4 in ranzure::platform::bufferManager::get1KBuffer ( ---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit--- </p> <blockquote> <p> this=0x6de6c0 &lt;ranzure::platform::bufferManager::getInstance()::instance&gt;) at buffmanager.cc:193 </p> </blockquote> <p> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/11" title="#11: Bugs: why not using mt19937? (closed: Fixed)">#11</a> 0x000000000047e7af in main (argc=1, argv=0x7fff0a023158) at client.cc:67 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12809 Trac 1.4.3 naidu.trk@… Fri, 03 Feb 2017 10:47:57 GMT <link>https://svn.boost.org/trac10/ticket/12809#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12809#comment:1</guid> <description> <p> <a class="ext-link" href="http://stackoverflow.com/questions/42020285/crash-in-boost-interprocess-cached-adaptive-pool-with-allocate-one-method"><span class="icon">​</span>http://stackoverflow.com/questions/42020285/crash-in-boost-interprocess-cached-adaptive-pool-with-allocate-one-method</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>