Interprocess anonymous mutex hangs with Apple Silicon
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- operating-systems
Research direction
Start with the minimal reproducer in boost_interprocess.cpp and run the listed cleanup and arm64/x86_64 commands on the M1 environment. Inspect the managed_shared_memory and interprocess_mutex paths involved in the architecture-dependent shared mutex state; done means both execution orders print "Critical section" without hanging.
Written by the indexing model from the issue text.
Description
Hi, boost interprocess anonymous mutex seems not to be handling well in ARM64 of Apple Silicon.
#include <iostream>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/sync/interprocess_mutex.hpp>
using namespace boost::interprocess;
int main() {
try{
managed_shared_memory managed_shm{open_or_create, "shm", 1024};
interprocess_mutex *mtx =
managed_shm.find_or_construct<interprocess_mutex>("mtx")();
mtx->lock();
std::cout << "Critial section" << std::endl;
mtx->unlock();
} catch (const boost::interprocess::interprocess_exception &e) {
std::cerr << "Interprocess exception thrown: " << e.what() << std::endl;
_exit(1);
}
}
Compilation steps followed
clang++ -std=c++17 -arch arm64 boost_interprocess.cpp -I<BOOST_HOME> -o boost_interprocess_arm64 # For arm64 only build
clang++ -std=c++17 -arch x86_64 boost_interprocess.cpp -I<BOOST_HOME> -o boost_interprocess_x64 # For x64 only build
Expected Behavior
Both the instantiations should work and print Critical Section.
What was observed
When arm64 build is executed first, it works fine, but when x64 build is executed, the subsequent arm64 execution hangs.
Steps to reproduce
rm /tmp/boost_interprocess/shm./boost_interprocess_x64./boost_interprocess_arm64
Environment tested on
- MacBook Air (M1, 2020)
- MacOS Monterey 12.3.1
- Apple clang version 13.1.6 (clang-1316.0.21.2.5)
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/interprocess
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
boostorg/interprocess#196 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
boostorg/interprocess#279 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
boostorg/interprocess#274 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
boostorg/interprocess#268 · 4 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
boostorg/interprocess#262 · 2 comments ·
All issues in boostorg/interprocess
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100