Created attachment 199919 [details] posix_fallocate fallback patch The code in bridges/source/cpp_uno/shared/vtablefactory.cxx can use ftruncate() or posix_fallocate(), with a preference for the later if available. Unfortunately, posix_fallocate() may be available while not implemented on a specific underlying filesystem. In this case, EOPNOTSUPP is returned. The current code is unable to handle that gracefuly, the error is fatal. Attached patch attempts to improve the situation by falling back to ftruncate() when posix_fallocate() returns EOPNOTSUPP. I also introduced a static flag to remember the failure, and avoid future posix_fallocate() usage if it does not work. While there, this file has two memory allocator, one that mmap() memory RWX, and another more complicated double-mmap RW+RX scheme for systems that enforce a W^X policy. Current behavior is to always try the former allocator, then fall back to the later. I introduced a flag to remember the failure, and avoid future RWX mmap() attempts if it does not work
Emmanuel Dreyfus committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9fb26786b75e30df593378954044af4e4753a192 tdf#165837 Avoid UNO failure if filesystem does not implement fallocate. It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Feel free to close as fixed.