This functionality and test was recently added in CL 592415. It fails on GOOS=openbsd specifically:
=== RUN TestMmapPtr
mmap_unix_test.go:72: Munmap: invalid argument
--- FAIL: TestMmapPtr (0.00s)
(From https://ci.chromium.org/b/8744139430297328801.)
CC @golang/openbsd, @ncruces.
Comment From: gabyhelp
Similar Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: gopherbot
Change https://go.dev/cl/595095 mentions this issue: unix: fix MmapPtr test failing on OpenBSD
Comment From: ncruces
So this should be fixed in https://github.com/golang/sys/pull/199
I ran a GitHub action on a branch that stacks both fixes, and all tests pass on: - linux - darwin - freebsd - openbsd - netbsd - illumos
So, hopefully, this doesn't cause any more issues.