SHM marker is broken on mixed 32-bit/64-bit usage
The SHM code at https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/blob/master/src/pulsecore/shm.c#L82 is broken:
/* We now put this SHM marker at the end of each segment. It's
* optional, to not require a reboot when upgrading, though. Note that
* on multiarch systems 32bit and 64bit processes might access this
* region simultaneously. The header fields need to be independent
* from the process' word with */
struct shm_marker {
pa_atomic_t marker; /* 0xbeefcafe */
pa_atomic_t pid;
uint64_t _reserved1;
uint64_t _reserved2;
uint64_t _reserved3;
uint64_t _reserved4;
} PA_GCC_PACKED;
pa_atomic_t
is a wrapper around int
, and that is not machine-independent like the rest of the struct
.