[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tmpfs loses unlinked files

From: Samuel Thibault
Subject: tmpfs loses unlinked files
Date: Sat, 28 Feb 2015 12:22:47 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)


For instance the X server crashes on fvwm startup, or mupdf crashes,
when /run is served by a tmpfs.

What happens is that they create an shm (shmget, thus a file in
/run/shm/, backed by tmpfs), then map it (shmat, i.e. open/mmap/close of
the file), then remove access to it (shmctl(IPC_RMID), i.e. unlink the

The issue is that even if the file is still mapped, unlinking it from
tmpfs makes tmpfs mach_port_deallocate the memobj, which apparently
drops the object completely, and subsequent accesses to the mmap thus
fail with SIGBUS.  Would there be a way for tmpfs to know about the
mappings of the pager object, to avoid shutting it down?  Or a way to
keep the object alive even if tmpfs has deallocated its port to it?
I don't know memory management enough to answer it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]