Subject: bug#64123: "stat -f -c '%T' ." on alpha fails with EOVERFLOW with NFS

From: matoro <[email-masked]>
Date: Sat, 17 Jun 2023 15:53:53 -0400

On 2023-06-17 15:23, Paul Eggert wrote:
> On 2023-06-17 10:30, Pádraig Brady wrote:
>> I see that s390 and alpha are the only 64 bit architectures
>> that have a 32-bit ino_t for example, which may cause issues within 
>> glibc?
> 
> Weird.
> 
> What happens if you compile with -D_FILE_OFFSET_BITS=64? Does this 
> cause alpha to have a 64-bit ino_t? (How does that work, exactly?) If 
> so, then AC_SYS_LARGEFILE should check for this and should arrange for 
> "#define _FILE_OFFSET_BITS 64".
> 
> Matoro, what happens if you compile the following C program?
> 
> 
> #include <sys/stat.h>
> #include <stdio.h>
> 
> int
> main (void)
> {
>   int n = sizeof (ino_t);
>   printf ("%d\n", n);
> }
> 
> 
> Compile and run it like this:
> 
> gcc ino.c
> ./a.out
> gcc -D_FILE_OFFSET_BITS=64 ino.c
> ./a.out
> 
> If the former prints "4" and the latter "8" then we can fix Autoconf 
> and Gnulib AC_SYS_LARGEFILE to do the right thing.
> 
> Also, as Pádraig suggests, the output of the following shell command 
> would be useful:
> 
> strace stat -f -c '%T' .
> 
> Also please see 
> <https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1899582>. 
> Although it's about s390x I expect there are similar issues on alpha, 
> which may not be fixed and if so it's not a coreutils issue per se.

This indeed seems to be the issue, thank you.  Compiling with 
-D_FILE_OFFSET_BITS=64 fixes the problem.

For reference, here is the additional requested information.

strace:  https://paste.matoro.tk/o1te2ek
config.h:  https://paste.matoro.tk/93xerfg

Thank you for your help!