POSIX Shared-Memory Startup: Prevent a Second Process from Using Half-Initialized State
Electing the creator of a POSIX shared-memory object does not mean the object is ready for another process to use. A successful exclusive shm_open can publish a name while its length is still zero and its synchronization objects are uninitialized. Separate creation, sizing, initialization and readiness publication, and require attachers to pass each boundary before…