boostorg / boostorg/interprocess

Interprocess anonymous mutex hangs with Apple Silicon

Abierto
#176 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
185
Forks
131
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza con el reproductor mínimo en boost_interprocess.cpp y ejecuta los comandos de limpieza y de arm64/x86_64 indicados en el entorno M1. Inspecciona las rutas de managed_shared_memory e interprocess_mutex implicadas en el estado del mutex compartido dependiente de la arquitectura; se considera terminado cuando ambos órdenes de ejecución imprimen "Critical section" sin quedarse bloqueados.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp
Área
operating-systems
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.