From ae3ab88153db9e83b3eb981121727be7c6bc3346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Fri, 19 Jun 2026 08:25:25 +0200 Subject: [PATCH] std.os.linux.x32: fix read of stack slot containing ctid in clone() It's a 32-bit pointer and passed on the stack; the upper 32 bits of the stack slot are garbage. This means that we ask the kernel to write to some random 64-bit location, which it will just silently fail to do (the process is in x32 mode; nothing can be mapped up there), and consequently, the thread's child_tid field will never be populated, causing a later join() to hang. --- lib/std/os/linux/x32.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/os/linux/x32.zig b/lib/std/os/linux/x32.zig index 6cf18045b35a6501f11bd009c0c7d17d25cc6447..3b10612786a6d256775c3f3dbe068b1ced5e352b 100644 --- a/lib/std/os/linux/x32.zig +++ b/lib/std/os/linux/x32.zig @@ -130,7 +130,7 @@ pub fn clone() callconv(.naked) u32 { \\ mov %%rdx,%%rdi \\ mov %%r8,%%rdx \\ mov %%r9,%%r8 - \\ mov 8(%%rsp),%%r10 + \\ mov 8(%%rsp),%%r10d \\ mov %%r11,%%r9 \\ and $-16,%%rsi \\ sub $8,%%rsi -- 2.54.0