
Using boost::interprocess from boost_1_37_0 on FreeBSD 7.0, I get a segmentation fault in pthread_mutex_lock() from /lib/libthr.so. 3, in what appears to anything related to a ShmemAllocator. For example, when I run the example from http://www.boost.org/doc/libs/1_37_0/doc/html/interprocess/allocators_contai... I get the segfault at this line: //Initialize the STL-like allocator const ShmemAllocator alloc_inst (segment.get_segment_manager()); I stepped back to this simple test after encountering this segfault (always in pthread_mutex_lock) when trying to use almost any function of segment_manager from managed_mapped_file. This is from an mapped file boost::interprocess::map structure that works very well on darwin. Is there any hope to getting this to work on FreeBSD? ----------------------------------------------------------------------------------------------- FWIW, here is the complete text of the example: void test_ipc2() { using namespace boost::interprocess; shared_memory_object::remove("MySharedMemory"); try{ //A managed shared memory where we can construct objects //associated with a c-string managed_shared_memory segment(create_only, "MySharedMemory", //segment name 65536); //Alias an STL-like allocator of ints that allocates ints from the segment typedef allocator<int, managed_shared_memory::segment_manager> ShmemAllocator; //Alias a vector that uses the previous STL-like allocator typedef vector<int, ShmemAllocator> MyVector; int initVal[] = {0, 1, 2, 3, 4, 5, 6 }; const int *begVal = initVal; const int *endVal = initVal + sizeof(initVal)/sizeof(initVal[0]); //Initialize the STL-like allocator const ShmemAllocator alloc_inst (segment.get_segment_manager()); //Construct the vector in the shared memory segment with the STL- like allocator //from a range of iterators MyVector *myvector = segment.construct<MyVector> ("MyVector")/*object name*/ (begVal /*first ctor parameter*/, endVal /*second ctor parameter*/, alloc_inst /*third ctor parameter*/); BOOST_CHECK(myvector); //Use vector as your want std::sort(myvector->rbegin(), myvector->rend()); // . . . //When done, destroy and delete vector from the segment segment.destroy<MyVector>("MyVector"); } catch(...){ shared_memory_object::remove("MySharedMemory"); throw; } shared_memory_object::remove("MySharedMemory"); }