<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 16, 2017 at 12:33 AM, Alex Rousskov <span dir="ltr"><<a href="mailto:rousskov@measurement-factory.com" target="_blank">rousskov@measurement-factory.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 03/15/2017 03:24 AM, Gary Wang wrote:<br>
> Regarding the confinement of usage of shared memory in snap world,<br>
> Please take a look at the bug<br>
> <a href="https://bugs.launchpad.net/snappy/+bug/1653955" rel="noreferrer" target="_blank">https://bugs.launchpad.net/<wbr>snappy/+bug/1653955</a><br>
<br>
</span>The above bug is about semaphores. Squid does not use semaphores (our<br>
implementation of shared memory objects is lockless). Squid uses shared<br>
memory segments created by shm_open(), not sem_open() system calls.<br>
A: Sorry about that, I need to make it clear at this point.</blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The above bug description appears to imply that snap allows<br>
/dev/shm/snap.@{SNAP_NAME}.* names, which are not the names used in your<br>
prior examples (IIRC). The sem.* pattern you used confused reviewers<br>
into thinking that you are trying to solve the wrong problem. The actual<br>
problem you are trying to solve (AFAICT) is valid and is not about the<br>
"sem." prefix but about the "snap." prefix.<br>
<span class="gmail-">A: Yes, We finally see it the same way. </span>Just a little correction. </blockquote><div> In snap world, only the following name pattern is allowed</div><div> <span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">/dev/shm/</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">sem.snap.</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">@{SNAP_</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">NAME}.*</span></div><div> not </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"> </span><span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">/dev/shm/</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">snap.</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">@{SNAP_</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">NAME}.*</span></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
<br>
> And Jamie's reply can be fuond in snapcraft maillist<br>
> <a href="https://www.mail-archive.com/snapcraft@lists.snapcraft.io/msg02465.html" rel="noreferrer" target="_blank">https://www.mail-archive.com/<wbr>snapcraft@lists.snapcraft.io/<wbr>msg02465.html</a><br>
<br>
</span>Again, that feels like an irrelevant piece of information here because<br>
it is specific to semaphores that Squid does not use.<br>
<br>
<br>
If I am right, then your argument should be something like this:<br>
<br>
1. Snap does not allow arbitrary names in /dev/shm/.<br>
2. Snap allows names matching /dev/shm/snap.@{SNAP_NAME}.* (and others) </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
3. I need to make Squid names for /dev/shm/ files configurable<br>
so that they can be forced to match one of the snap-allowed patterns.<br>
A: Right, but again snap-allowed name pattern</blockquote><div> /dev/shm/snap.@{SNAP_NAME}.*</div><div> should be</div><div> <span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">/dev/shm/</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">sem.snap.</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">@{SNAP_</span><wbr style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px"><span style="color:rgb(51,51,51);font-family:monospace;font-size:13.3333px">NAME}.*</span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Please note that it is theoretically possible that OS shm_open()<br>
implementation (in Squid context) creates some secret temporary files<br>
just like sem_open() does in Python context. That would mean that other<br>
names/patterns may be in play here as well. However, since you know that<br>
your patch "works", my argument sketch above remains valid even if there<br>
are other OS-created names that we do not know about.<br>
<br>
<br>
HTH,<br>
<br>
Alex.<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Br<div>Gary.Wzl</div></div></div>
</div></div>