Boost logo

Boost Testing :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2007-11-13 12:14:42


Boris Gubenko escribió:
> Hi Ion,
>
> thank you for the willingness to help with Interprocess library on HP-UX.
>
> What kind of information do you need? Do you want me to walk through the
> code with the debugger to see which libc function fails, presumably with
> EACCES ? Do you have an example, a simple C program, showing how the
> Interprocess library calls shared memory functions or mmap, if this is
> what you suspect is failing on HP-UX?

Yes, I would need the call stack to the point where the exception is
being thrown. I suspect that either shm_open or mmap are failing so:

-> mmap is called in file boost/interprocess/mapped_region.hpp line 469.

-> shm_open in boost/interprocess/shared_memory_object.hpp line 327.

You will see error handling code there, so you can put a breakpoint when
shm_open/mmap returns an error. A simple example to test if shared
memory creation is failing is to test something like this:

#include <boost/interprocess/shared_memory_object.hpp>

using namespace boost::interprocess;

int main()

{
    const char *name = "/shm_name";
    shared_memory_object::remove(name);
    {
      shared_memory_object shm(create_only, name, read_write)
    }
    shared_memory_object::remove(name);
    return 0;
}

To execute a little more complicated example (including mmap use) try
shared_memory_mapping_test.cpp

Regards,

Ion


Boost-testing list run by mbergal at meta-comm.com