Boost logo

Boost Users :

Subject: [Boost-users] [IPC Named Mutex]
From: Lorenzo Trivelli (trivelli.lorenzo_at_[hidden])
Date: 2015-04-16 04:01:58


Hi to everyone,
I'm experiencing a strange behaviour of named mutex on
a windows 2008 machine.
symptoms: when the system event log is empty, creation
of named mutex fails with a boost::interprocess::interprocess:exception
with msg boost::interprocess_exception::library_error.
Now some data:
1) Boost 1.57.0 + stlport 5.2
2) VS 2005
3) Target Environment: Win 2008/32
3) after a night of code digging I managed to crete a small sample
which raises the exception:

#include <boost/shared_ptr.hpp>
#include <boost/interprocess/sync/named_mutex.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>
#include <iostream>

typedef boost::shared_ptr<boost::interprocess::named_mutex> safe_ipc_mx;

static safe_ipc_mx __mx;
int main(void) {
        system("pause");
        try {
                __mx = safe_ipc_mx(new boost::interprocess::named_mutex(boost::interprocess::open_or_create_t(),"JAEGER"));
                std::cout << std::endl << "Mutex created !" << std::endl;
        } catch(boost::interprocess::interprocess_exception const& e) {
                std::cout << std::endl << "Mutex creation error " << e.what() << " /" << e.get_error_code() << " /" << e.get_native_error();
        }
        system("pause");
        return 0;

}

as far as I digged, it seems that the trouble is in the winapi::get_last_bootup_time(stamp) call
in shared_dir_helpers.hpp, but up to now I had not been able to reproduce it on a machine with
all the debugging tools installed

does anyone have a clue on what I am doing wrong ?

thanks in advance
Lorenzo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net