From 19a65a76b5898de78eadbb2c8de88b662b00a56c Mon Sep 17 00:00:00 2001 From: Theodore Dubois Date: Sun, 24 May 2020 22:41:31 -0700 Subject: [PATCH] Fix locking on mem in cpu_step This caused hangs out of nowhere in ptraceomatic --- jit/jit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jit/jit.c b/jit/jit.c index 602078c9fb..b331092cfa 100644 --- a/jit/jit.c +++ b/jit/jit.c @@ -299,7 +299,9 @@ int cpu_step32(struct cpu_state *cpu, struct tlb *tlb) { struct jit_block *block = state.block; struct jit_frame frame = {.cpu = *cpu}; + read_wrlock(&cpu->mem->lock); int interrupt = jit_enter(block, &frame, tlb); + read_wrunlock(&cpu->mem->lock); *cpu = frame.cpu; jit_block_free(NULL, block); return interrupt;