x32 regressions
Dmitry V. Levin
ldv at altlinux.org
Wed May 1 17:01:41 UTC 2013
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):
* file.c [X32] (HAVE_STAT64, STAT64_SIZE): Define.
[X32] (realprintstat64, sys_fstat64, sys_stat64): Remove.
---
file.c | 87 ++----------------------------------------------------------------
1 file changed, 2 insertions(+), 85 deletions(-)
diff --git a/file.c b/file.c
index 837bfed..b6133db 100644
--- a/file.c
+++ b/file.c
@@ -118,6 +118,8 @@ struct stat64 {
unsigned long st_ctime_nsec;
unsigned long long st_ino;
};
+# define HAVE_STAT64 1
+# define STAT64_SIZE 96
struct __old_kernel_stat {
unsigned short st_dev;
@@ -2722,88 +2724,3 @@ sys_swapon(struct tcb *tcp)
}
return 0;
}
-
-#ifdef X32
-# undef stat64
-# undef sys_fstat64
-# undef sys_stat64
-
-static void
-realprintstat64(struct tcb *tcp, long addr)
-{
- struct stat64 statbuf;
-
- if (!addr) {
- tprints("NULL");
- return;
- }
- if (syserror(tcp) || !verbose(tcp)) {
- tprintf("%#lx", addr);
- return;
- }
-
- if (umove(tcp, addr, &statbuf) < 0) {
- tprints("{...}");
- return;
- }
-
- if (!abbrev(tcp)) {
- tprintf("{st_dev=makedev(%lu, %lu), st_ino=%llu, st_mode=%s, ",
- (unsigned long) major(statbuf.st_dev),
- (unsigned long) minor(statbuf.st_dev),
- (unsigned long long) statbuf.st_ino,
- sprintmode(statbuf.st_mode));
- tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
- (unsigned long) statbuf.st_nlink,
- (unsigned long) statbuf.st_uid,
- (unsigned long) statbuf.st_gid);
- tprintf("st_blksize=%lu, ",
- (unsigned long) statbuf.st_blksize);
- tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
- }
- else
- tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
- switch (statbuf.st_mode & S_IFMT) {
- case S_IFCHR: case S_IFBLK:
- tprintf("st_rdev=makedev(%lu, %lu), ",
- (unsigned long) major(statbuf.st_rdev),
- (unsigned long) minor(statbuf.st_rdev));
- break;
- default:
- tprintf("st_size=%llu, ", (unsigned long long) statbuf.st_size);
- break;
- }
- if (!abbrev(tcp)) {
- tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
- tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
- tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
- tprints("}");
- }
- else
- tprints("...}");
-}
-
-int
-sys_fstat64(struct tcb *tcp)
-{
- if (entering(tcp)) {
- printfd(tcp, tcp->u_arg[0]);
- tprints(", ");
- } else {
- realprintstat64(tcp, tcp->u_arg[1]);
- }
- return 0;
-}
-
-int
-sys_stat64(struct tcb *tcp)
-{
- if (entering(tcp)) {
- printpath(tcp, tcp->u_arg[0]);
- tprints(", ");
- } else {
- realprintstat64(tcp, tcp->u_arg[1]);
- }
- return 0;
-}
-#endif
> desc.c: In function ‘printflock’:
> desc.c:270:2: warning: format ‘%ld’ expects argument of type ‘long int’, but
> argument 2 has type ‘__off_t’ [-Wformat]
> desc.c:270:2: warning: format ‘%ld’ expects argument of type ‘long int’, but
> argument 3 has type ‘__off_t’ [-Wformat]
And it actually does incorrect decoding on x32.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20130501/a1bfb990/attachment.bin>
More information about the Strace-devel
mailing list