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
41
42
43
44
45
46
47
|
id = 982
title = "linux-user: --strace incorrectly decodes writev arguments for 64-bit binaries on 32-bit machine"
state = "opened"
created_at = "2022-04-13T13:14:05.485Z"
closed_at = "n/a"
labels = ["linux-user"]
url = "https://gitlab.com/qemu-project/qemu/-/issues/982"
host-os = "Gentoo"
host-arch = "i686"
qemu-version = "6.2.0"
guest-os = "linux-user"
guest-arch = "x86_64, aarch64"
description = """With `--strace`, the arguments to `writev` appear to be decoded incorrectly.
The syscall still succeeds and has the expected effects."""
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
```"""
additional = "n/a"
|