amd64 strace misprints 64 bit i386 off_t



Package: strace
Version: 4.5.15-1.1ubuntu1
Severity: normal

I compiled this program under 32 bit debian lenny:

#define _XOPEN_SOURCE 500
#define _FILE_OFFSET_BITS 64

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

int main (int argc, char **argv)
{
int fd = open(argv[0], O_RDONLY);
char buf[1];

off_t offset = (off_t)0x100000001ULL;
fprintf(stderr, "%llu\n", (unsigned long long)offset);
pread(fd, buf, 1, offset);

return 0;
}

on this system strace prints:
[...]
open("stracetest", O_RDONLY|O_LARGEFILE) = 3
write(2, "4294967297\n"..., 114294967297
) = 11
pread64(3, ""..., 1, 4294967297) = 0
exit_group(0) = ?

on the 64 bit machine under hardy strace prints:

open("stracetest", O_RDONLY|O_LARGEFILE) = 3
write(2, "4294967297\n", 114294967297
) = 11
pread64(3, "", 1, 1) = 0
exit_group(0) = ?

I haven't looked further if this is a problem with 32 bit compatibility
in the kernel syscall entry or in strace but because strange things
should happen if this is a kernel problem I assume it is strace.

-- System Information:
Debian Release: lenny/sid
APT prefers hardy-updates
APT policy: (500, 'hardy-updates'), (500, 'hardy-security'), (500, 'hardy'), (200, 'hardy-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-19-generic (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages strace depends on:
ii libc6 2.7-10ubuntu3 GNU C Library: Shared libraries

strace recommends no packages.

-- no debconf information

--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Relevant Pages

  • Re: InDependance
    ... packages are needed to build the new one. ... needed using strace after the package is built. ... Freedom is actually a bigger game than power, ...
    (Fedora)
  • Re: 2.6.28 headers break kbd and net-tools userspace builds
    ... packages and others against every new release of linux and linux-stable, (hence my initial report). ...
    (Linux-Kernel)
  • Re: InDependance
    ... to determine which files are used in the building of a rpm, ... packages are needed to build the new one. ... Build the package in mock, which builds in an environment with very ... needed using strace after the package is built. ...
    (Fedora)
  • Cannot run lsbcc and lsbc++
    ... I have installed the LSB 1.3 development packages from linuxbase.org and ... the error message "No such file or directory", even if I cd into the ... Same problem when using the LSB 2.0 package. ... strace: exec: No such file or directory ...
    (comp.os.linux.development.apps)
  • 2.6-test6: nanosleep+SIGCONT weirdness
    ... int main(int argc, char* argv[]) { ... # strace ./n ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)