boost::flyweight::intermodule_holder on LINUX is segfaulting

Open
#218 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp, linux

Research direction

Start by reproducing the Linux failure described in the Boost mailing-list report and inspect boost::flyweight::intermodule_holder. Trace the temporary path used for locking and examine get_current_process_creation_time on Linux. Done means the reported shared-memory collision or dangling-lock scenario is isolated and the cause is documented or fixed with a verified reproduction.

Written by the indexing model from the issue text.

Description

Reported in the Boost mailing list:

https://lists.boost.org/boost-users/2024/05/91583.php

Apparently the boost::flyweight::intermodule_holder on LINUX is creating shared memory objects, which by accident (crash?) can persist after the process having created them is already gone.

As a result the code can attempt to create an already existing shared memory object created by another user.

It seems like locking is based on a unique temporary filesystem path that uses both the process ID and its start time:

So, the code should be robust against dangling locks because the combination (PID, start time) won't ever repeat. Maybe you can debug your program and try to isolate the actual path generated for the offending scenario?

It might be related with the lame implementation of get_current_process_creation_time in Linux.

Dominant language
C++
Stars
185
Forks
131
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/interprocess

All issues in boostorg/interprocess

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.