-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Got "Cannot allocate memory" in Go 1.8, after strip app, run successfully. #19983
Comments
I believe this is a known issue (see #19734). There is also one comment in that thread noting that stripping the binary seems to fix it. |
Yes, this is likely #19734. Please upgrade to go1.8.1, that should fix it. Closing. Comment here if you can still reproduce with go1.8.1. and we'll re-open. |
I upgrade to go1.8.1, this issue is gone. |
I reproduced this on go 1.8.1 Steps
|
@tylrtrmbl are you absolutely sure that you nuked everything you had and rebuild it with go1.8.1? If yes, please open a new issue with details (a way to reproduce would be great, if you are allowed to share the code). |
Silly me. Spent an extra hour tracking it down this morning, and finally just moved my go 1.8 binary to the trash to prove it was using 1.8.1... it wasn't. Now I found the problem. Sorry for the noise. |
No problem, thanks for checking. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rm/pwgcqbl91wl2kj768xl2967h0000gn/T/go-build524964552=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
I upgrade my mac from 10.10 (Yosemite) to 10.12.1 (macOS Sierra).
Then I cannot run binary which
go build
outputted, and no errors found in/var/log/system.log
.But after I strip it, I can run it successfully.
Simplified Makefile
run: go build -o app ./app
then, I run followings
$ make run make: ./app: Cannot allocate memory make: *** [run] Error 1 $ ./app Killed: 9 $ ls -l app -rwxr-xr-x 1 subchen wheel 5902620 Apr 15 14:08 app $ strip app $ ls -l app -rwxr-xr-x 1 subchen wheel 5092444 Apr 15 14:13 app $ ./app Listening https://192.168.199.153:8080/v1/ ...
The text was updated successfully, but these errors were encountered: