id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 6201,managed_shared_memory construstor crashes,djgaspa@…,Ion Gaztañaga,"The following code crashes with segmentation fault when compiled with the symbol -DNDEBUG and optimization -O1 or -O2 or -O3 using gcc 4.6.1 from ubuntu oneiric. {{{ int main(int argc, char** argv) { namespace bi = boost::interprocess; const char* name = ""foobar""; bi::shared_memory_object::remove(name); bi::managed_shared_memory segment(bi::create_only, name, 10 * 1024 * 1024); } }}} Without the NDEGUB symbol it always works. With NDEBUG it works only with -O0. The call stack obtained with -O1 -g -DNDEBUG is the following: {{{ Program received signal SIGSEGV, Segmentation fault. get_color (n=) at /usr/include/boost/intrusive/detail/rbtree_node.hpp:136 136 { return (color)ptr_bit::get_bits(n->parent_); } (gdb) bt #0 get_color (n=) at /usr/include/boost/intrusive/detail/rbtree_node.hpp:136 #1 boost::intrusive::rbtree_algorithms, true> >::rebalance_after_insertion (header=..., p=...) at /usr/include/boost/intrusive/rbtree_algorithms.hpp:855 #2 0x0000000000409445 in insert_equal_upper_bound::block_ctrl>, boost::intrusive::rbtree_impl::block_ctrl, boost::intrusive::rbtree_node_traits, true>, (boost::intrusive::link_mode_type)0, boost::intrusive::default_tag, 3>, std::less::block_ctrl>, unsigned long, true> > > > (comp=..., new_node=..., h=...) at /usr/include/boost/intrusive/rbtree_algorithms.hpp:539 #3 boost::intrusive::rbtree_impl, 0ul>::block_ctrl, boost::intrusive::rbtree_node_traits, true>, (boost::intrusive::link_mode_type)0, boost::intrusive::default_tag, 3>, std::less, 0ul>::block_ctrl>, unsigned long, true> >::insert_equal (this=0x7ffff6477038, value=) at /usr/include/boost/intrusive/rbtree.hpp:482 #4 0x0000000000409550 in insert (value=, this=) at /usr/include/boost/intrusive/set.hpp:1569 #5 boost::interprocess::rbtree_best_fit, 0ul>::priv_add_segment (this=, addr=, size=) at /usr/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp:538 #6 0x0000000000409725 in rbtree_best_fit (this=0x7ffff6477010, extra_hdr_bytes=104, size=10485744) at /usr/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp:374 #7 segment_manager_base (reserved_bytes=104, size=10485744, this=0x7ffff6477010) at /usr/include/boost/interprocess/segment_manager.hpp:96 #8 boost::interprocess::segment_manager, 0ul>, boost::interprocess::iset_index>::segment_manager (this=0x7ffff6477010, size=10485744) at /usr/include/boost/interprocess/segment_manager.hpp:408 #9 0x000000000040a00b in create_impl (size=10485744, addr=0x7ffff6477010, this=0x7fffffffe0a0) at /usr/include/boost/interprocess/detail/managed_memory_impl.hpp:178 #10 operator() (created=true, size=10485744, addr=0x7ffff6477010, this=0x7fffffffe088) at /usr/include/boost/interprocess/detail/managed_memory_impl.hpp:735 #11 boost::interprocess::detail::managed_open_or_create_impl::priv_open_or_create, 0ul>, boost::interprocess::iset_index, 16ul> > > ( this=0x7fffffffe0a8, type=, id=, size=10485760, mode=, addr=0x0, perm=..., construct_func=...) at /usr/include/boost/interprocess/detail/managed_open_or_create_impl.hpp:374 #12 0x0000000000404bfb in managed_open_or_create_impl, boost::interprocess::iset_index, 16u> > > (construct_func=..., mode=boost::interprocess::read_write, id=@0x7fffffffe0f8, this=0x7fffffffe0a8, perm=..., addr=0x0, size=10485760) at /usr/include/boost/interprocess/detail/managed_open_or_create_impl.hpp:170 #13 basic_managed_shared_memory (perm=..., addr=0x0, size=10485760, name=0x40a8e8 ""foobar"", create_only=, this=0x7fffffffe0a0) at /usr/include/boost/interprocess/managed_shared_memory.hpp:90 #14 main (argc=, argv=) at /home/gaspa/programmazione/openni/main.cpp:25 }}}",Bugs,closed,To Be Determined,interprocess,Boost 1.47.0,Problem,wontfix,managed_shared_memory gcc optimization,