summary refs log tree commit diff stats
path: root/results/classifier/gemma3:27b/syscall/982
blob: 7302cb49d813a3ca3dd1408b056fc9d4e0f348d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
linux-user: --strace incorrectly decodes writev arguments for 64-bit binaries on 32-bit machine
Description of problem:
With `--strace`, the arguments to `writev` appear to be decoded incorrectly.
The syscall still succeeds and has the expected effects.
Steps to reproduce:
```
$ cat main.c
#include <sys/uio.h>

int main(void) {
  struct iovec iov;
  iov.iov_base = "hello, world!\n";
  iov.iov_len = 14;
  return writev(1, &iov, 1);
}

$ aarch64-unknown-linux-gnu-gcc -static -o aarch64-main main.c

$ x86_64-pc-linux-gnu-gcc -static -o x86_64-main main.c

$ i686-pc-linux-gnu-gcc -static -o i686-main main.c

$ ./i686-main
hello, world!

$ strace ./i686-main |& grep writev
writev(1, [{iov_base="hello, world!\n", iov_len=14}], 1hello, world!

$ qemu-i386 --strace ./i686-main |& grep writev
21953 writev(1,0x407ffe54,0x1) = 14

$ qemu-x86_64 --strace ./x86_64-main |& grep writev
22218 writev(1,(nil),0x407ffcc0) = 14

$ qemu-aarch64 --strace ./aarch64-main |& grep writev
22523 writev(1,(nil),0x407ffcc8) = 14
```