Opened 12 years ago

Closed 9 years ago

#4655 closed Bugs (fixed)

[Interprocess] The shared_memory_object::remove return false on success

Reported by: Kistner Eric <eric.kistner@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.50.0 Severity: Problem
Keywords: Cc:

Description

The shared_memory_object::remove return false on success. This is due to the code doing: return detail::delete_file(shmfile.c_str()) == 0;

but the detail::delete_file already return a bool that is true on succes

Simply remove the ==0 fix the problem.

Change History (6)

comment:1 by Kistner Eric <eric.kistner@…>, 12 years ago

Resolution: fixed
Status: newclosed

It seems to be fixed in the svn-trunk.

comment:2 by Volker Wippel <Volker.Wippel@…>, 11 years ago

Resolution: fixed
Status: closedreopened
Version: Boost 1.44.0Boost 1.46.1

boost 1.46.1, WinXP, MS VC2005

shared_memory_object::remove still returns false on success in about 1 of 30 calls. Label_A message below pops up.

string const name = m_ShMem->get_name();
m_TraceQueue->removeUser();  m_TraceQueue->~SharedMemTraceQueue();
delete m_ShRegion;           delete m_ShMem;
for (bool toDelete = true; toDelete; ) {
    toDelete = !boost::interprocess::shared_memory_object::remove(name.c_str());
    if (toDelete) {
        struct stat buff;    string fullName;
        boost::interprocess::detail::tmp_filename(name.c_str(), fullName);
        toDelete = (0 == stat(fullName.c_str(), &buff));
        if (toDelete)
            cerr << "Still trying to remove " << name << endl; //sleep...
        else
            cerr << name << " not existing anymore. Skip\n"; // Label_A
    }
}

comment:3 by Ion Gaztañaga, 11 years ago

Resolution: fixed
Status: reopenedclosed

Fixed in Boost 1.48

comment:4 by Volker.Wippel@…, 10 years ago

Resolution: fixed
Status: closedreopened
Version: Boost 1.46.1Boost 1.50.0

Fixed up to 1.49, again occurs in 1.50.

comment:5 by Ion Gaztañaga, 10 years ago

This seems related to bug #7923, that is already fixed. Can you try trunk code to see if this bug is also fixed?

comment:6 by Ion Gaztañaga, 9 years ago

Resolution: fixed
Status: reopenedclosed

This bug seems fixed with #7923.

Note: See TracTickets for help on using tickets.