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 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"