x32 regressions

Mike Frysinger vapier at gentoo.org
Wed May 1 17:55:18 UTC 2013


On Wednesday 01 May 2013 13:39:10 Dmitry V. Levin wrote:
> On Wed, May 01, 2013 at 01:31:50PM -0400, Mike Frysinger wrote:
> > On Wednesday 01 May 2013 13:01:41 Dmitry V. Levin wrote:
> > > On Wed, May 01, 2013 at 12:34:27PM -0400, Mike Frysinger wrote:
> > > > > 	x86_64 (x32) (linux-3.8.3 glibc-2.16 gcc-4.7.1) also fails:
> > > Looks like x32 was broken by commit v4.7-96-g8435d67.
> > > 
> > > > looks like you're already working on this.  the latest git rev now
> > > > looks like: file.c:2787:1: error: redefinition of ‘sys_fstat64’
> > > > file.c:1334:1: note: previous definition of ‘sys_fstat64’ was here
> > > > file.c:2799:1: error: redefinition of ‘sys_stat64’
> > > > file.c:1243:1: note: previous definition of ‘sys_stat64’ was here
> > > > make[2]: *** [file.o] Error 1
> > > 
> > > Please try this fix (I have no x32 nearby to check):
> > that gets me:
> > file.c: In function ‘printstat64’:
> > file.c:1068:2: error: size of unnamed array is negative
> 
> Well, it probably also needs this:
> 
> diff --git a/file.c b/file.c
> index b6133db..adf3356 100644
> --- a/file.c
> +++ b/file.c
> @@ -117,7 +117,7 @@ struct stat64 {
>  	unsigned long		st_ctime;
>  	unsigned long		st_ctime_nsec;
>  	unsigned long long	st_ino;
> -};
> +} __attribute__((packed));
>  # define HAVE_STAT64	1
>  # define STAT64_SIZE	96

that makes it build, but runtime is incorrect

$ cat test.c
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
        struct stat st;
        stat(argv[1], &st);
        printf("%llu\n", (unsigned long long)st.st_size);
}
$ gcc test.c

$ truncate -s 10G f
$ ls -lh f
-rw-r--r-- 1 root root 10G May  1 13:48 f

$ ./a.out f
10737418240

$ strace -V
strace -- version 4.7
$ strace -v -estat ./a.out f
stat("f", {st_dev=makedev(9, 0), st_ino=30545838, st_mode=S_IFREG|0644, 
st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, 
st_size=10737418240, st_atime=2013/05/01-13:48:52, 
st_mtime=2013/05/01-13:48:52, st_ctime=2013/05/01-13:48:52}) = 0
10737418240

$ ./strace -v -estat ./a.out f
--- stopped by SIGSTOP ---
--- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=32087, si_uid=0} ---
stat("f", {st_dev=makedev(9, 0), st_ino=30545838, st_mode=S_IFREG|0644, 
st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, 
st_size=2147483648, st_atime=2013/05/01-13:48:52, 
st_mtime=2013/05/01-13:48:52, st_ctime=2013/05/01-13:48:52}) = 0
10737418240

notice how st_size is wrong in the second one
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20130501/e5e52ffa/attachment.bin>


More information about the Strace-devel mailing list