-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: addrspace_free bug causes large mmap to fail on mips64 #14297
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
Comments
/cc @ianlancetaylor I tagged this Go1.6Maybe, if there's a tiny mips64-only fix. But it's not really a supported architecture yet, so it's probably a 1.7 issue. |
@bradfitz this file is used by all linux implementations. I think this warrants investigation as it could affect supported linux platforms. |
Yes, that's used by all linux implementations. We can investigate, but if nobody else is having problems, we don't want to touch common code this late in 1.6 if we can help it. Maybe all other architectures correct for this elsewhere but mips64 doesn't. That's the tiny fix I was alluding to. |
I'm concerned that with the exception of arm32, nothing |
On GNU/Linux, on 386, amd64, arm, and arm64, system calls return a negative errno value, in eax, rax, r0, r0, respectively. On mips64 and ppc64, they return a positive errno value, in r2 and r3, respectively. In the runtime package, I think that the implementation of mmap on arm64 is wrong and the implementation of mincore on mips64 and ppc64 is wrong. |
Thanks Ian. I wonder if the scavenger being disabled on arm64 and ppc64 What is the page size on mips64? On Thu, 11 Feb 2016, 16:21 Ian Lance Taylor [email protected]
|
Adjustable I think, but normally 4k.
|
@eswierk can you test https://golang.org/cl/19455? |
CL https://golang.org/cl/19455 mentions this issue. |
CL https://golang.org/cl/19457 mentions this issue. |
I tested https://golang.org/cl/19455 on mips64 hardware and it didn't work. I added a comment with details. |
Updates #14297 Change-Id: I6b5f5020af5efaaa71280bdeb2ff99785ee9b959 Reviewed-on: https://go-review.googlesource.com/19457 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Testing the new mips64 support, I ran into out of memory errors whenever the heap grew beyond ~500 MB. I isolated the problem to an apparent bug in addrspace_free (https://github.com/golang/go/blob/53b6661/src/runtime/mem_linux.go#L34). mincore returns _ENOMEM, not -_ENOMEM, if the given page is unmapped. Removing the minus sign makes the problem go away.
I don't know if there are any platforms where the return value is actually negative. The equivalent function in the gccgo runtime also assumes a positive value.
The text was updated successfully, but these errors were encountered: