Skip to contentSkip to conversation

Bug#604928: stat.2: EOVERFLOW not only for st_size; bit/byte confusion

PATCH New Simon Paillard 2 participants 3 messages Oct 22, 2012 – Nov 11, 2012 3 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20101125140830.GA14353-rNNsFfiJtZ89bTkMJW/[email protected]

#2 lore raw

Control: -1 found 3.42-1

Quoted 10 lines · Lionel Elie Mamane

stat(2) says:

ERRORS
(...)
EOVERFLOW
(stat()) path refers to a file whose size cannot be represented in the type off_t. This can occur when an application compiled on a 32-bit platform without -D_FILE_OFFSET_BITS=64 calls stat() on a file whose size exceeds (2<<31)-1 bits.

Quoted 2 lines

1) It would seem to me that the condition for this to occur would be a file whose size exceeds (2<<31)-1 *bytes*, not "bits".

Still applicable to manpages 3.43.

Quoted 2 lines

2) I got this for an overflow on st_ino (64 bit kernel, 32 bit userland, CIFS mount of a Windows-served share).

Confirmed with
OpenGroup: http://pubs.opengroup.org/onlinepubs/009695399/functions/stat.html
[EOVERFLOW]
The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf.

egblic: sysdeps/unix/sysv/linux/xstatconv.c it can be st_ino, st_size or st_blocks

Quoted 9 lines

So I'd suggest this text become something along the lines of:

path or fd refers to a file for which the value of a field of the stat structure cannot be represented in its type. This usually occurs with applications compiled on a 32-bit platform without -D_FILE_OFFSET_BITS=64. The most common occurrence is when such an application calls stat() on a file whose size exceeds (2<<31)-1 bytes; but it can also occur e.g. for the st_ino field, e.g. when such an application is run on a 64 bit kernel.

An other proposal attached.

Signature · 1 line
Simon Paillard
man2/stat.2 +7 -4
index 0b82e1d..fb2f9dd 100644
@@ -343,15 +343,18 @@ is not a directory.
 .B EOVERFLOW
 .RB ( stat ())
 .I path
-refers to a file whose size cannot be represented in the type
-.IR off_t .
-This can occur when an application compiled on a 32-bit platform without
+refers to a file whose size, inode number, or number of blocks cannot be represented in their respective type
+.IR off_t ,
+.IR ino_t ,
+or
+.IR blkcnt_t .
+This usually occurs when an application compiled on a 32-bit platform without
 .I -D_FILE_OFFSET_BITS=64
 calls
 .BR stat ()
 on a file whose size exceeds
 .I (1<<31)-1
-bits.
+bytes.
 .SH "CONFORMING TO"
 These system calls conform to SVr4, 4.3BSD, POSIX.1-2001.
 .\" SVr4 documents additional

A message that is not in the archive (sent off-list or not yet received): 20121022235500.GA16004-8MNqHwMchPhGJ/[email protected]

#4 lore raw

PATCH 1/1 stat.2: EOVERFLOW not only for st_size, not in bits

egblic: sysdeps/unix/sysv/linux/xstatconv.c it can be st_ino, st_size or st_blocks

See http://bugs.debian.org/604928

---
 man2/stat.2 |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
man2/stat.2 +7 -4
index d4838a2..c7886b0 100644
@@ -343,15 +343,18 @@ is not a directory.
 .B EOVERFLOW
 .RB ( stat ())
 .I path
-refers to a file whose size cannot be represented in the type
-.IR off_t .
-This can occur when an application compiled on a 32-bit platform without
+refers to a file whose size, inode number, or number of blocks cannot be represented in their respective type
+.IR off_t ,
+.IR ino_t ,
+or
+.IR blkcnt_t .
+This usually occurs when an application compiled on a 32-bit platform without
 .I -D_FILE_OFFSET_BITS=64
 calls
 .BR stat ()
 on a file whose size exceeds
 .I (1<<31)-1
-bits.
+bytes.
 .SH "CONFORMING TO"
 These system calls conform to SVr4, 4.3BSD, POSIX.1-2001.
 .\" SVr4 documents additional
Signature · 6 lines
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw
In reply to a message not in the archive

tags 604928 fixed-upstream
thanks

Quoted 40 lines · Simon Paillard

Control: -1 found 3.42-1

Quoted 10 lines · Lionel Elie Mamane

stat(2) says:

ERRORS
(...)
EOVERFLOW
(stat()) path refers to a file whose size cannot be represented in the type off_t. This can occur when an application compiled on a 32-bit platform without -D_FILE_OFFSET_BITS=64 calls stat() on a file whose size exceeds (2<<31)-1 bits.

Quoted 2 lines

1) It would seem to me that the condition for this to occur would be a file whose size exceeds (2<<31)-1 *bytes*, not "bits".

Still applicable to manpages 3.43.

Quoted 2 lines

2) I got this for an overflow on st_ino (64 bit kernel, 32 bit userland, CIFS mount of a Windows-served share).

Confirmed with
OpenGroup: http://pubs.opengroup.org/onlinepubs/009695399/functions/stat.html
[EOVERFLOW]
The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf.

egblic: sysdeps/unix/sysv/linux/xstatconv.c it can be st_ino, st_size or st_blocks

Quoted 9 lines

So I'd suggest this text become something along the lines of:

path or fd refers to a file for which the value of a field of the stat structure cannot be represented in its type. This usually occurs with applications compiled on a 32-bit platform without -D_FILE_OFFSET_BITS=64. The most common occurrence is when such an application calls stat() on a file whose size exceeds (2<<31)-1 bytes; but it can also occur e.g. for the st_ino field, e.g. when such an application is run on a 64 bit kernel.

Quoted 1 line

An other proposal attached.

Thanks Simon. I applied a modified version of your patch, as below.

Cheers,

Michael

man2/stat.2 +11 -5
@@ -341,17 +341,23 @@ A component of the path prefix of
 is not a directory.
 .TP
 .B EOVERFLOW
-.RB ( stat ())
 .I path
-refers to a file whose size cannot be represented in the type
-.IR off_t .
-This can occur when an application compiled on a 32-bit platform without
+or
+.I fd
+refers to a file whose size, inode number,
+or number of blocks cannot be represented in, respectively, the types
+.IR off_t ,
+.IR ino_t ,
+or
+.IR blkcnt_t .
+This error can occur when, for example,
+an application compiled on a 32-bit platform without
 .I -D_FILE_OFFSET_BITS=64
 calls
 .BR stat ()
 on a file whose size exceeds
 .I (1<<31)-1
-bits.
+bytes.
 .SH "CONFORMING TO"
 These system calls conform to SVr4, 4.3BSD, POSIX.1-2001.
 .\" SVr4 documents additional
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html