Enable large file support on 32-bit Linux - #9481
Closed
geri1701 wants to merge 1 commit into
Closed
Conversation
On 32-bit Linux, off_t and related types default to 32 bits. In the 0.28.x branch, stat() can return EOVERFLOW when an inode number exceeds UINT32_MAX. FileIo::size() converts that error to SIZE_MAX, causing misleading mmap() ENOMEM and vector max_size() failures. Define _FILE_OFFSET_BITS=64 for CMake and Meson builds.
Collaborator
|
32-bit Linux is obsolete, so I don't think it's a good idea to add extra complexity to our build system to support it. I'd prefer to improve the error handling in the code. Is this the code that's causing the problem? Lines 205 to 211 in dc9364b We should probably let that exception go up to the main function and exit with an error message. |
Author
|
Thanks. We’ll keep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On 32-bit Linux,
stat()in the 0.28.x branch can returnEOVERFLOWwhen an inode number exceedsUINT32_MAX.FileIo::size()converts that error toSIZE_MAX, which causes misleadingmmap()ENOMEMandstd::vector::max_size()failures.This defines
_FILE_OFFSET_BITS=64for 32-bit Linux in both CMake and Meson builds.mainalso usesfseeko()andftello(), so it benefits from 64-bit file offsets. The patch applies unchanged to0.28.x.Verification:
main: all 6 CTest suites pass serially on i686 and x86_640.28.9: all 5 CTest suites pass on i686 and x86_64