SIGN IN SIGN UP

[darwin]: pass kernel buffers as unsafe.Pointer on darwin

purego maps uintptr to uintptr_t, a plain integer: it neither keeps the
pointee alive nor makes it escape. A Go local therefore stays on the
goroutine stack, and its address goes stale as soon as the stack grows,
leaving the kernel to write into the old stack while the caller reads
zeroes.

This was latent until the shared library handle removed the per-call
Dlopen, whose deep call chain had been growing the stack before the
address was taken and hiding the bug. TestMemoryInfo and TestExe caught
it; TestNumThread had been asserting only n >= 0 and passing on zero.
S
shirou committed
ccd5ddba639f19532c1e38fa517a8fc0d76d6bf7
Parent: 2114d0d