SIGBUS when writing to a wl_shm surface on a full tmpfs / ftruncate() vs fallocate()
Olivier Blin
olivier.blin at softathome.com
Tue Oct 22 11:54:10 CEST 2013
On 21/10/2013 22:37, Kristian Høgsberg wrote:
> On Wed, Oct 16, 2013 at 07:29:47PM +0200, Olivier BLIN wrote:
> > Hi,
> >
> > When creating a wl_shm pool with os_create_anonymous_file(), the
> > underlying storage file is created on a tmpfs, and its size is set
> > with ftruncate().
> > Though, when the tmpfs isn't big enough to hold this file, there is
> > no error at the pool creation, since it is handled as a sparse file
> > and its size is not reserved on the filesystem.
> >
> [...]
> >
> > Having a small tmpfs is likely a common use in the embedded world,
> > and it would be nice to avoid such obscure crashes if possible.
> > What do you think of using fallocate() when supported instead of
> > ftruncate() in wayland/weston?
>
> I think using fallocate sounds like a better approach, thanks for
> bringing it up. Are you thinking about implementing this?
Hi Kristian,
Sure, I will prepare patches for this in wayland and weston.
Thanks
--
Olivier Blin - SoftAtHome
More information about the wayland-devel
mailing list