-
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
runtime: "found bad pointer in Go heap" when running net/http test #42944
Comments
Looks like it found an invalid pointer on the stack. This could be a compiler liveness thing, possibly? |
It could be. But it seems weird, though. The bad pointer is found at 0x9cf38f4, which is the argument area of this frame:
It is FP+12, i.e. the fourth word. The function signature is
So it is the first word of the result. PC 0xbb is the instruction right after the morestack call. So it is preempted synchronously at function entry, where the result shouldn't be live. And it is indeed not, if I decode the liveness map correctly. |
Since it is not statically live, another possibility is that it is scanned as a stack object. From the stack trace
It is actually scanning stack objects.
points to the object.
which is I can see a few possibilities for fixing:
Any one of them would fix this. |
It should be, it is marked as such in 386Ops.go. I think it's basically never a good idea to have pointers into the callee args area. At least, those pointers should be very short lived - just enough to be passed to memmove. Maybe we could type such pointers as uintptr instead of a real pointer, as the GC should never care about them. |
Sounds like a good idea. |
Hmmm, if the stack moves, these pointers still need to be adjusted. So we probably cannot simply type them as uintptr. Maybe we really need to ensure they are short lived (e.g. always rematerialized, never spilled). |
Change https://golang.org/cl/275174 mentions this issue: |
2020-12-01T23:14:14-6f84993/linux-386
CC @aclements @mknyszek
The text was updated successfully, but these errors were encountered: