[PATCH xwayland] xwayland-shm: fortify fallocate against EINTR

Ian Ray ian.ray at ge.com
Mon Apr 25 12:56:58 UTC 2016


On Mon, Apr 25, 2016 at 02:40:31PM +0200, Marek Chalupa wrote:
> 
> On 04/25/16 12:20, Pekka Paalanen wrote:
> > On Mon, 25 Apr 2016 11:33:00 +0200
> > Marek Chalupa <mchqwerty at gmail.com> wrote:
> >
> >> If posix_fallocate or ftruncate is interrupted by signal
> >> while working, we return -1 as fd and the allocation process
> >> returns BadAlloc error. That causes xwayland clients to abort
> >> with 'BadAlloc (insufficient resources for operation)'
> >> even when there's a lot of resources available.
> >>
> >> Fix it by trying again when we get EINTR.

I have recently hit this, on a rather low powered platform, and solved
the problem slightly differently by falling-back to ftruncate. (Posted
to the list just now in a separate thread.)

<snip>
> > Hi Marek,
> >
> > curious, how did you hit this case? And is the signal that intercept
> > these usually the smart scheduler's SIGALRM?
> 
> Hi Pekka,
> 
> under gnome-shell it's enough to open terminator and resize it very
> quickly. Under Weston (and also gnome-shell) I hit this with Firefox.
> Just start it and in a moment it goes down with this error.

I wonder if immediately falling-back to ftruncate is too aggressive?

Blue skies,
Ian



More information about the xorg-devel mailing list