<div dir="ltr">Alright. Here is the patch as git patch. Hope that works.<div><br></div><div>I left out the "flags" variable from the shm_open() call that you showed, since I didn't see it being used or declared anywhere.</div><div><br></div><div>The commit message is lengthy, but I tried to explain what's going on, so others don't have to go digging for the same problem in the future.</div><div><br></div><div>I did test it, and it works "as advertised". I noticed that the 4.0 code base of Squid does a much better job of cleaning up after itself than 3.5 did. With 3.5, I could trigger the problem by starting Squid in the foreground ("squid -N") and then hitting Ctrl-C twice (the second time would interrupt the cleanup process). With the 4.0 code base, I had to use "kill -9" to get it to leave the shared memory segments behind. My other attempts at triggering the problem failed, because it continued to clean up properly, despite being sent multiple signals.</div><div><br></div><div>The improved cleanup is good news. It means the EEXIST condition won't be hit nearly as much as it would otherwise.</div><div><br></div><div>Regards,</div><div>-Markus</div></div>