-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/sys/unix: MmapPtr upsets checkptr #70721
Comments
This is a correct report. You cannot remap the Go stack or heap. You'd have to either pass |
Here is the full scope of my crime: https://pkg.go.dev/github.com/Jille/gcmmap I agree that people shouldn't remap the Go heap or stack and expect the Go compatibility promise to apply to them. However, if someone got here it seems unlikely they did it by accident. If they're doing something wrong with the unsafe.Pointer they're passing in, checkptr should catch it before the call. Once mmap returns I think people likely are getting what they asked for. |
I'm not sure that's possible. It is ok by the
But |
Go version
go version go1.23.2 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I'm using
unix.MmapPtr()
withunix.MAP_FIXED
, which triggers checkptr (for example when run with-race
).https://go.dev/play/p/3raMoMpk-YA (build with
-race
to trigger the error)What did you see happen?
What did you expect to see?
This is the implementation of MmapPtr. The compiler can't prove this conversion from uinptr to unsafe.Pointer is safe.
The text was updated successfully, but these errors were encountered: