Project

General

Profile

Actions

Bug #11262

closed

stat() calls in Wt may cause EOVERFLOW on 32 bit builds

Added by Roel Standaert almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Roel Standaert
Target version:
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

Actions #1

Updated by Roel Standaert almost 2 years ago

  • Status changed from New to InProgress
  • Assignee set to Roel Standaert
Actions #2

Updated by Roel Standaert almost 2 years ago

  • Target version changed from 4.10.0 to 4.9.2
Actions #3

Updated by Roel Standaert almost 2 years ago

  • Status changed from InProgress to Review
  • Assignee deleted (Roel Standaert)
Actions #4

Updated by Roel Standaert almost 2 years ago

Attaching a patch that simply replaces our uses of stat() with boost::filesystem.

Actions #5

Updated by Marnik Roosen almost 2 years ago

  • Assignee set to Marnik Roosen
Actions #6

Updated by Roel Standaert almost 2 years ago

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Marnik Roosen to Roel Standaert
Actions #7

Updated by Roel Standaert almost 2 years ago

  • Status changed from Implemented @Emweb to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Roel Standaert over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF