Activity log for bug #1810433

Date Who What changed Old value New value Message
2019-01-03 18:05:36 Matwey V. Kornilov bug added bug
2019-01-03 18:06:39 Matwey V. Kornilov attachment added Test case source file https://bugs.launchpad.net/qemu/+bug/1810433/+attachment/5226714/+files/main.c
2019-01-03 18:07:50 Matwey V. Kornilov description Hello, I am running aarch64-linux-user from master, commit 20d6c7312f1b812bb9c750f4087f69ac8485cc90 And I've found the following inconsistent emulation of pwrite() call when buf==NULL and len=0. Minimal reproducible sample is the following: #define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <string.h> /* System | Result -------------------------+---------------- Native x86_64 4.12.14 | pwrite ret = 0 Native aarch64 4.4.159 | pwrite ret = 0 qemu-aarch64 at x86_64 | pwrite ret = -1 ( 20d6c7312f1b8 ) | */ int main(int argc, char** argv) { int fd = open("test.dat", O_CREAT | O_RDWR, 0644); if (fd < 0) { perror("open"); return 1; } int ret = fallocate(fd, 0, 0, 1000); if (ret < 0) { perror("fallocate"); return 1; } ssize_t ret_pwrite = pwrite(fd, NULL, 0, 0); printf("pwrite ret = %ld\n", ret_pwrite); close(fd); return 0; } Hello, I am running aarch64-linux-user from master, commit 20d6c7312f1b812bb9c750f4087f69ac8485cc90 And I've found the following inconsistent emulation of pwrite() call when buf==NULL and len=0. Minimal reproducible sample is the following: #define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <string.h> /*  System | Result -------------------------+----------------  Native x86_64 4.12.14 | pwrite ret = 0  Native aarch64 4.4.159 | pwrite ret = 0  qemu-aarch64 at x86_64 | pwrite ret = -1    ( 20d6c7312f1b8 ) | */ int main(int argc, char** argv) {  int fd = open("test.dat", O_CREAT | O_RDWR, 0644);  if (fd < 0) {   perror("open");   return 1;  }  int ret = fallocate(fd, 0, 0, 1000);  if (ret < 0) {   perror("fallocate");   return 1;  }  ssize_t ret_pwrite = pwrite(fd, NULL, 0, 0);  printf("pwrite ret = %ld\n", ret_pwrite);  close(fd);  return 0; } Please note, that the same binary executable prints different output at native aarch64 platform and under aarch64-linux-user
2019-01-03 18:09:22 Matwey V. Kornilov attachment added Test binary statically compiled for aarch64 https://bugs.launchpad.net/qemu/+bug/1810433/+attachment/5226715/+files/pwrite_test.aarch64
2019-01-08 19:02:08 Peter Maydell qemu: status New In Progress
2019-01-18 16:27:16 Peter Maydell qemu: status In Progress Fix Committed
2019-04-24 05:20:04 Thomas Huth qemu: status Fix Committed Fix Released