Bug #11262
stat() calls in Wt may cause EOVERFLOW on 32 bit builds
Start date:
01/18/2023
Due date:
% Done:
100%
Estimated time:
Description
A user using a 32 bit build of Wt reported via email that it is possible to get the following error (EOVERFLOW
):
stat: Value too large for defined data type Document root (".") not valid.
This happened when the document root was located on a network share. Perhaps this network share was using inode numbers that were too large?
This is what the stat(2)
man page has to say about it:
EOVERFLOW pathname or fd refers to a file whose size, inode number, or number of blocks cannot be represented in, respectively, the types off_t, ino_t, or blkcnt_t. This error can occur when, for exam‐ ple, an application compiled on a 32-bit platform without -D_FILE_OFFSET_BITS=64 calls stat() on a file whose size exceeds (1<<31)-1 bytes.
There are a few ways we can fix this. We can either make sure -D_FILE_OFFSET_BITS=64
is defined, or we can go less low level and use boost::filesystem
or std::filesystem
's status
function. I propose we go for the latter option and replace our own uses of the stat()
function with the appropriate use of boost::filesystem
instead.
Files
Updated by Roel Standaert 5 months ago
- File 0001-WT-11262-replace-uses-of-stat-with-boost-filesystem.patch 0001-WT-11262-replace-uses-of-stat-with-boost-filesystem.patch added
Attaching a patch that simply replaces our uses of stat()
with boost::filesystem
.