
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