Skip to content
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: report "out of memory" if Solaris mmap fails with EAGAIN #14930

Closed
calmh opened this issue Mar 23, 2016 · 9 comments
Closed

runtime: report "out of memory" if Solaris mmap fails with EAGAIN #14930

calmh opened this issue Mar 23, 2016 · 9 comments

Comments

@calmh
Copy link
Contributor

calmh commented Mar 23, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

Go 1.6

  1. What operating system and processor architecture are you using (go env)?
jb@lxslave:~$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
jb@lxslave:~$ 

Cross compiled for solaris/amd64.

  1. What did you do?

Running latest version (master, v0.13.0-beta.0-147-g31362df) of Syncthing. Used to run stable on Solaris.

  1. What did you expect to see?

No unexpected crashes.

  1. What did you see instead?
runtime: address space conflict: map(0xc85b130000) = 0xb
fatal error: runtime: address space conflict

runtime stack:
runtime.throw(0xc9e8a0, 0x1f)
        /usr/local/go/src/runtime/panic.go:530 +0x99 fp=0xfffffd7ffb5ffc58 sp=0xfffffd7ffb5ffc40
runtime.sysMap(0xc85b130000, 0x100000, 0xfffffd7fff28d500, 0x1152d18)
        /usr/local/go/src/runtime/mem_bsd.go:84 +0x139 fp=0xfffffd7ffb5ffc98 sp=0xfffffd7ffb5ffc58
runtime.(*mheap).sysAlloc(0x1138760, 0x100000, 0xfffffd7ffb5ffda0)
        /usr/local/go/src/runtime/malloc.go:429 +0x191 fp=0xfffffd7ffb5ffd20 sp=0xfffffd7ffb5ffc98
runtime.(*mheap).grow(0x1138760, 0x8, 0x0)
        /usr/local/go/src/runtime/mheap.go:651 +0x63 fp=0xfffffd7ffb5ffd78 sp=0xfffffd7ffb5ffd20
runtime.(*mheap).allocSpanLocked(0x1138760, 0x4, 0xfffffd7ffe5b5268)
        /usr/local/go/src/runtime/mheap.go:553 +0x4e3 fp=0xfffffd7ffb5ffdd0 sp=0xfffffd7ffb5ffd78
runtime.(*mheap).alloc_m(0x1138760, 0x4, 0x10000000042, 0xfffffd7ffe5b5268)
        /usr/local/go/src/runtime/mheap.go:437 +0x122 fp=0xfffffd7ffb5ffe00 sp=0xfffffd7ffb5ffdd0
runtime.(*mheap).alloc.func1()
        /usr/local/go/src/runtime/mheap.go:502 +0x41 fp=0xfffffd7ffb5ffe30 sp=0xfffffd7ffb5ffe00
runtime.systemstack(0xfffffd7ffb5ffe50)
        /usr/local/go/src/runtime/asm_amd64.s:307 +0xc1 fp=0xfffffd7ffb5ffe38 sp=0xfffffd7ffb5ffe30
runtime.(*mheap).alloc(0x1138760, 0x4, 0x10000000042, 0x452818)
        /usr/local/go/src/runtime/mheap.go:503 +0x63 fp=0xfffffd7ffb5ffe80 sp=0xfffffd7ffb5ffe38
runtime.(*mcentral).grow(0x113b710, 0x0)
        /usr/local/go/src/runtime/mcentral.go:209 +0x93 fp=0xfffffd7ffb5ffee8 sp=0xfffffd7ffb5ffe80
runtime.(*mcentral).cacheSpan(0x113b710, 0xfffffd7ffe5b5268)
        /usr/local/go/src/runtime/mcentral.go:89 +0x47d fp=0xfffffd7ffb5fff28 sp=0xfffffd7ffb5ffee8
runtime.(*mcache).refill(0xfffffd7fff10f4b0, 0x42, 0xfffffd7ffe5b5268)
        /usr/local/go/src/runtime/mcache.go:119 +0xd5 fp=0xfffffd7ffb5fff60 sp=0xfffffd7ffb5fff28
runtime.mallocgc.func2()
        /usr/local/go/src/runtime/malloc.go:642 +0x2b fp=0xfffffd7ffb5fff80 sp=0xfffffd7ffb5fff60
runtime.systemstack(0xc820020000)
        /usr/local/go/src/runtime/asm_amd64.s:291 +0x86 fp=0xfffffd7ffb5fff88 sp=0xfffffd7ffb5fff80
runtime.mstart()
        /usr/local/go/src/runtime/proc.go:1048 fp=0xfffffd7ffb5fff90 sp=0xfffffd7ffb5fff88
@ianlancetaylor ianlancetaylor changed the title fatal error: runtime: address space conflict runtime: fatal error: runtime: address space conflict Mar 23, 2016
@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Mar 23, 2016
@ianlancetaylor
Copy link
Contributor

Does this happen consistently? Can you tell us how to recreate the problem?

The call to mmap seems to have failed with EAGAIN. That suggests that you may be out of swap space.

@calmh
Copy link
Contributor Author

calmh commented Mar 23, 2016

It could indeed be that it's running out of memory. I don't have a small reproducer, but I can allocate more memory to the system and see if that's the case. If it is, we can close this, otherwise I'll try to narrow it down.

(If it's "just" a case of running out of memory, could the error possibly be worded more clearly? I would not have filed an issue for fatal error: runtime: out of memory...)

@ianlancetaylor
Copy link
Contributor

We do print a better error message for ENOMEM, which is what is returned on GNU/Linux in that case. I had to look at the Solaris man page to see what EAGAIN means on Solaris. If the problem is indeed being out of memory, we can handle EAGAIN like ENOMEM.

@calmh
Copy link
Contributor Author

calmh commented Mar 23, 2016

👍 The memory handling is a bit different on Solaris as every allocation is indeed a swap allocation and there is no memory overcommit. :) This is also in a zone, which means memory is limited artificially by a quota. That could mean we get different error messages back from the system calls, I'm not sure.

@calmh
Copy link
Contributor Author

calmh commented Mar 23, 2016

I'm not seeing this crash after raising the amount of available memory, so I think that's it, yes.

@ianlancetaylor ianlancetaylor changed the title runtime: fatal error: runtime: address space conflict runtime: report "out of memory" if Solaris mmap fails with EAGAIN Mar 23, 2016
@ianlancetaylor ianlancetaylor modified the milestones: Unplanned, Go1.7 Mar 23, 2016
@ianlancetaylor
Copy link
Contributor

Thanks for following up. Leaving the issue open to change the error message when mmap returns EAGAIN on Solaris.

@choman
Copy link

choman commented Sep 28, 2016

so I am trying to get this to work (using syncthing 0.14.7) on sol10
out.txt

My error is similar to above (see attached):
Please tell me that I do not need go installed?

The system is a sol10 server with like 260G of ram

@ianlancetaylor
Copy link
Contributor

@choman I don't think that what you are seeing has anything to do with this issue. Please use a forum (http://golang.org/wiki/Questions) or open a new issue.

@gopherbot
Copy link

CL https://golang.org/cl/43461 mentions this issue.

@golang golang locked and limited conversation to collaborators May 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants