boostorg / boostorg/interprocess

Interprocess anonymous mutex hangs with Apple Silicon

Offen
#176 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
185
Forks
131
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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)

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit dem minimalen Reproducer in boost_interprocess.cpp und führe die aufgeführten cleanup- sowie arm64/x86_64-Befehle in der M1-Umgebung aus. Untersuche die Pfade von managed_shared_memory und interprocess_mutex, die am architekturabhängigen Zustand des Shared Mutex beteiligt sind; abgeschlossen ist die Arbeit, wenn beide Ausführungsreihenfolgen "Critical section" ausgeben, ohne hängen zu bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
operating-systems
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.