strace: on i386, prints sync_file_range() arguments wrongly

Bug #697742 reported by Peter Maydell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
strace (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: strace

Package: strace
Version: 4.5.20-2ubuntu2

strace on i386 does not print the arguments to sync_file_range correctly:

cam-vm-266:maverick:qemu$ cat /tmp/sync_file_range.c
#define _GNU_SOURCE
#include <stdio.h>
#include <fcntl.h>

int main(void) {
 int r;
 printf("calling sync_file_range()...\n");
 r = sync_file_range(42, 0x123456789abcdefULL, 0x1122334455667788ULL, 273750);
 printf("returned %d\n", r);
 return 0;
}
cam-vm-266:maverick:qemu$ gcc -g -Wall -o /tmp/sync_file_range /tmp/sync_file_range.c
cam-vm-266:maverick:qemu$ strace /tmp/sync_file_range 2>&1 | grep '^sync_file_range'
sync_file_range(0x2a, 0x89abcdef, 0x1234567, 0x55667788) = -1 EINVAL (Invalid argument)

I think this is because strace doesn't know that the 2nd and 3rd arguments here are both off64_t so it's assuming it takes four 32 bit arguments. On x86_64 where a 64 bit value fits into one register anyway this bug doesn't occur.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.