Shared memory segment getting deleted? : <p>I'm using a simple pthreads process-shared mutex in a shared memory segment to coordinate multiple server instances.</p>

<p>Code is straightforward:<br>
On startup server attaches to shared memory segment if it exists, or creates it if it doesn't:<br>
<code>shm_open()</code>, <code>mmap(MAP_SHARED)</code> etc.</p>

<p>This works very well while testing, but once deployed after a while i come across cases where server instances don't coordinate at all. I can replicate this by deleting the shared memory segment after a server has started: future servers instances will create/use a new segment but the existing one is stuck with the old segment nobody uses so in effect it's isolated from the rest ...</p>

<p>So my guess is the shared memory segment in /dev/shm is getting deleted somehow, and not by me. This is the only thing that makes sense... What is going on here ??</p>

<p>Running debian with linux 4.9.</p>
