boostorg / boostorg/interprocess
Interprocess anonymous mutex hangs with Apple Silicon
- 主要言語
- C++
- スター
- 185
- フォーク
- 131
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Hi, boost interprocess anonymous mutex seems not to be handling well in ARM64 of Apple Silicon.
```C++
#include
#include
#include
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("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**
```bash
clang++ -std=c++17 -arch arm64 boost_interprocess.cpp -I -o boost_interprocess_arm64 # For arm64 only build
clang++ -std=c++17 -arch x86_64 boost_interprocess.cpp -I -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)
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
boost_interprocess.cpp の最小再現コードから始め、M1 環境で列挙されている cleanup コマンドと arm64/x86_64 コマンドを実行します。アーキテクチャ依存の共有 mutex 状態に関係する managed_shared_memory と interprocess_mutex のパスを調査します。完了の条件は、どちらの実行順序でもハングせずに "Critical section" と出力されることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- operating-systems
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100