On Sun, Apr 04, 2021 at 01:43:17AM +0200, Thomas L. wrote: > Hi, > > trying to start screen capture in firefox currently leads to a pledge(2) > violation, cause it calls shmget(2). You can test this by going to > https://meet.jit.si, creating a room and trying to screen share. > The patch below avoids this, by not trying to setup XShm for the screen > capture. Firefox will fall back to a slower non-shm method, which is > good enough to share a terminal session and is better than killing > the browser I think :).
Thanks for the proposition, i have to admit i never looked into that issue as that's a feature i dont use. I've filed https://bugzilla.mozilla.org/show_bug.cgi?id=1702919 upstream to get some feedback first. Sadly, we can't know at runtime if pledge is in action or not, so we cant use shm when pledge is disabled and ximage when it's enabled. > A proper fix would probabaly require a lot restructuring, since > the size of the shared memory depends on the selected window/screen. The proper fix would be to init shm before pledge, but as you figured out this might be hard. Thanks for digging into this :) Landry