about summary refs log tree commit diff stats
path: root/reproducers
diff options
context:
space:
mode:
authorReimersS <sebastian.reimers@tum.de>2025-11-07 15:45:32 +0000
committerTheofilos Augoustis <theofilos.augoustis@gmail.com>2025-11-14 15:14:20 +0000
commit014e07a7128e23c0130fef3d74459f4159d0fe4d (patch)
treefa8773f2d6db0a4a19e558559c224d378009d75f /reproducers
parent82027de31eb5ec497a4b56ee94986316b0491890 (diff)
downloadfocaccia-014e07a7128e23c0130fef3d74459f4159d0fe4d.tar.gz
focaccia-014e07a7128e23c0130fef3d74459f4159d0fe4d.zip
Deterministic replay (single threaded, no memory)
Diffstat (limited to 'reproducers')
-rw-r--r--reproducers/issue-508.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/reproducers/issue-508.c b/reproducers/issue-508.c
index e143183..c8fd251 100644
--- a/reproducers/issue-508.c
+++ b/reproducers/issue-508.c
@@ -1,13 +1,18 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <sys/random.h>
 
 int main() {
   int mem = 0x12345678;
+  int buf = 0;
+  getrandom(&buf, sizeof(buf), 0);
   register long rax asm("rax") = 0x1234567812345678;
-  register int edi asm("edi") = 0x77777777;
+  register int edi asm("edi") = buf;
   asm("cmpxchg %[edi],%[mem]"
       : [ mem ] "+m"(mem), [ rax ] "+r"(rax)
       : [ edi ] "r"(edi));
   long rax2 = rax;
   printf("rax2 = %lx\n", rax2);
+  printf("rand= %d\n", buf);
 }