We do a ftruncate on files for shared memory we allocate on Linux: https://searchfox.org/mozilla-central/rev/c61720a7d0c094d772059f9d6a7844eb7619f107/ipc/chromium/src/base/shared_memory_posix.cc#255 An alternative is fallocate: https://linux.die.net/man/2/fallocate https://linux.die.net/man/3/ftruncate But this just causes a SIGSEGV at allocation instead of random places in the code. This may be an improvement, but ultimately it would be nice if we could just fail gracefully.....
Bug 1582954 Comment 9 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
We do a ftruncate on files for shared memory we allocate on Linux: https://searchfox.org/mozilla-central/rev/c61720a7d0c094d772059f9d6a7844eb7619f107/ipc/chromium/src/base/shared_memory_posix.cc#255 An alternative is fallocate or posix_fallocate: https://linux.die.net/man/2/fallocate https://linux.die.net/man/3/ftruncate