summary refs log tree commit diff stats
path: root/results/classifier/zero-shot-user-mode/instruction/1906193
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-07-08 13:28:15 +0200
committerChristian Krinitsin <mail@krinitsin.com>2025-07-08 13:28:28 +0200
commit5aa276efcbd67f4300ca1a7f809c6e00aadb03da (patch)
tree9b8f0e074014cda8d42f5a97a95bc25082d8b764 /results/classifier/zero-shot-user-mode/instruction/1906193
parent1a3c4faf4e0a25ed0b86e8739d5319a634cb9112 (diff)
downloadqemu-analysis-5aa276efcbd67f4300ca1a7f809c6e00aadb03da.tar.gz
qemu-analysis-5aa276efcbd67f4300ca1a7f809c6e00aadb03da.zip
restructure results
Diffstat (limited to 'results/classifier/zero-shot-user-mode/instruction/1906193')
-rw-r--r--results/classifier/zero-shot-user-mode/instruction/190619363
1 files changed, 63 insertions, 0 deletions
diff --git a/results/classifier/zero-shot-user-mode/instruction/1906193 b/results/classifier/zero-shot-user-mode/instruction/1906193
new file mode 100644
index 000000000..994641c6a
--- /dev/null
+++ b/results/classifier/zero-shot-user-mode/instruction/1906193
@@ -0,0 +1,63 @@
+instruction: 0.439
+runtime: 0.384
+syscall: 0.177
+
+
+
+riscv32 user mode emulation: fork return values broken
+
+When running in a chroot with riscv32 (on x86_64; qemu git master as of today):
+
+The following short program forks; the child immediately returns with exit(42). The parent checks for the return value - and obtains 40!
+
+gcc-10.2
+
+===============================================
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/wait.h>
+
+main(c, v)
+     int c;
+     char **v;
+{
+  pid_t pid, p;
+  int s, i, n;
+
+  s = 0;
+  pid = fork();
+  if (pid == 0)
+    exit(42);
+
+  /* wait for the process */
+  p = wait(&s);
+  if (p != pid)
+    exit (255);
+
+  if (WIFEXITED(s))
+  {
+     int r=WEXITSTATUS(s);
+     if (r!=42) {
+      printf("child wants to return %i (0x%X), parent received %i (0x%X), difference %i\n",42,42,r,r,r-42);
+     }
+  }
+}
+===============================================
+
+(riscv-ilp32 chroot) farino /tmp # ./wait-test-short 
+child wants to return 42 (0x2A), parent received 40 (0x28), difference -2
+
+===============================================
+(riscv-ilp32 chroot) farino /tmp # gcc --version
+gcc (Gentoo 10.2.0-r1 p2) 10.2.0
+Copyright (C) 2020 Free Software Foundation, Inc.
+Dies ist freie Software; die Kopierbedingungen stehen in den Quellen. Es
+gibt KEINE Garantie; auch nicht für MARKTGÄNGIGKEIT oder FÜR SPEZIELLE ZWECKE.
+
+(riscv-ilp32 chroot) farino /tmp # ld --version
+GNU ld (Gentoo 2.34 p6) 2.34.0
+Copyright (C) 2020 Free Software Foundation, Inc.
+This program is free software; you may redistribute it under the terms of
+the GNU General Public License version 3 or (at your option) a later version.
+This program has absolutely no warranty.
\ No newline at end of file