summary refs log tree commit diff stats
path: root/results/classifier/gemma3:27b/runtime/1648
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-07-06 16:43:19 +0000
committerChristian Krinitsin <mail@krinitsin.com>2025-07-06 16:43:19 +0000
commit238ec2b7cc1557d6f34c33cc482e4d0cd3e266dd (patch)
treecd8a1b75ba7b3543eb7fe6857f408e7be4d9fd0b /results/classifier/gemma3:27b/runtime/1648
parent96049c939b1916d80532630d63c14e04d5244f1d (diff)
downloademulator-bug-study-238ec2b7cc1557d6f34c33cc482e4d0cd3e266dd.tar.gz
emulator-bug-study-238ec2b7cc1557d6f34c33cc482e4d0cd3e266dd.zip
add results
Diffstat (limited to 'results/classifier/gemma3:27b/runtime/1648')
-rw-r--r--results/classifier/gemma3:27b/runtime/164861
1 files changed, 61 insertions, 0 deletions
diff --git a/results/classifier/gemma3:27b/runtime/1648 b/results/classifier/gemma3:27b/runtime/1648
new file mode 100644
index 00000000..e69c4038
--- /dev/null
+++ b/results/classifier/gemma3:27b/runtime/1648
@@ -0,0 +1,61 @@
+
+
+
+linux-user: incorrect alignment of sigframe::pretcode & rt_sigframe::pretcode cause crash
+Description of problem:
+Corrent Print Result:
+
+sp: cdd3b4e8
+
+SUCCEEDED!
+
+qemu-x86_64 Print Result:
+
+sp: 2804170
+
+qemu: uncaught target signal 11 (Segmentation fault) - core dumped
+
+Segmentation fault
+
+Reason of Bug:
+
+sigframe::pretcode & rt_sigframe::pretcode must align of 16n-sizeof(void*) instead of 16n, Because rsp align of 16n before instruction "call" in caller, After "call", push address of "call" in caller. sp of begin in callee is 16n-sizeof(void*)
+
+For example on x86_64:
+
+reference to "qemu/linux-user/i386/signal.c"
+
+```
+# define TARGET_FPSTATE_FXSAVE_OFFSET 0
+
+struct rt_sigframe {
+    abi_ulong pretcode;
+    struct target_ucontext uc;
+    struct target_siginfo info;
+    struct target_fpstate fpstate QEMU_ALIGNED(16);
+};
+#define TARGET_RT_SIGFRAME_FXSAVE_OFFSET (                                 \
+    offsetof(struct rt_sigframe, fpstate) + TARGET_FPSTATE_FXSAVE_OFFSET)
+```
+
+offsetof(struct rt_sigframe, fpstate) align of 16
+
+TARGET_FPSTATE_FXSAVE_OFFSET is 0
+
+TARGET_RT_SIGFRAME_FXSAVE_OFFSET is 16n, also alignment of fxsave is 64
+
+so address of rt_sigframe::pretcode is 16n instead of 16n - sizeof(void*), It is incorect!
+
+Fix the bug:
+
+```
+struct rt_sigframe {
+    abi_ulong pretcode;
+    struct target_ucontext uc;
+    struct target_siginfo info;
+    abi_ulong unused QEMU_ALIGNED(16);
+    struct target_fpstate fpstate;
+};
+```
+
+offsetof(struct rt_sigframe, fpstate) is 16n+8, so address of rt_sigframe::pretcode is 16n-8 on x86_64.