glGetUniformLocation fails in confinement mode

Spencer spencertparkin at gmail.com
Mon Jan 30 15:57:50 UTC 2017


Okay, I remember now.  I was silently skipping absent shader files because, as I understand it, a shader program may consist of only a vertex program or only a fragment program or some other permutation of vertex, fragment, geometry and compute shaders.  In a better API, I would flag the permutation I'm expecting, then barf if that is not what's found on disk.

Thanks again for your help.  I was kind of hoping it wasn't me being dumb, but alas, it was.

> On Jan 30, 2017, at 8:50 AM, Spencer <spencertparkin at gmail.com> wrote:
> 
> Oh, you're right!  I don't know why I silently fail when the file doesn't exist.  That was stupid.
> 
> And I can see that I'm installing all resource files except for the shaders directory.  That's the problem.
> 
> My bad; I'm an idiot.  Thanks.  I'll resnap later today after work when I get the chance between toddler screams and house work.
> 
>>> On Jan 30, 2017, at 6:47 AM, Stephen M. Webb <stephen.webb at canonical.com> wrote:
>>> 
>>> On 2017-01-30 01:56 AM, Spencer Parkin wrote:
>>> 
>>> I have a program that has successfully snapped and run in confinement mode, but then I added a pixel and vertex shader
>>> which works when run on my classic system, but not in strict confinement as a snap.  I've tried to narrow down the
>>> earliest fail point, and I believe it is at the point where I'm calling glGetUniformFromLocation.  This is returning -1
>>> in confinement mode.  I'm able to read, compile and link my shader program, and bind it, but the first call to
>>> glGetUniformFromLocation fails.  Is OpenGL being denied read-access to a portion of protected memory?  If so, it
>>> certainly would fail to write there as well with a call to glUniform3f, for example.
>>> 
>>> I've tried hooking up the snappy-debug's log-observe plug to that of ubuntu core's, then running the scanlog, but the
>>> only app-armer denial I get is, I believe, unrelated to the problem.  In any case, I will give it here...
>>> 
>>> Log: apparmer="DENIED" operation="open" profile="snap.twistypuzzle.twistypuzzle" name="/usr/share/glib-2.0/schemas/"
>>> pid=23593 comm="desktop-launch" request_mask="r" denied_mask="r" fsuid=1000 ouid=0
>>> File: /usr/share/glib-2.0/schemas/ (read)
>> 
>> That error message is because the launcher program "desktop-launch" can not find the gsettings.  I don't know what
>> impact that will have (if any) but it's not going to affect how OpenGL works internally.
>> 
>> Your glGetUniformFromLocation() sounds more like you haven't compiled the shader.  You code contains no error handling
>> if the shader file itself is not found, only if the shader file is found and fails to compile.  My guess is the shader
>> sources are not getting found under confinement.
>> 
>> -- 
>> Stephen M. Webb  <stephen.webb at canonical.com>
>> 
>> -- 
>> Snapcraft mailing list
>> Snapcraft at lists.snapcraft.io
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft




More information about the Snapcraft mailing list