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

all.bash: freebsd12.1 - go1.16.3 - build failed - out of memory #45759

Closed
nerotiger opened this issue Apr 25, 2021 · 10 comments
Closed

all.bash: freebsd12.1 - go1.16.3 - build failed - out of memory #45759

nerotiger opened this issue Apr 25, 2021 · 10 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@nerotiger
Copy link

nerotiger commented Apr 25, 2021

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

$ go version
1.16.3

Does this issue reproduce with the latest release?

YES

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GOPATH="/home/water/my_go"
GORACE=""
GOROOT="/home/water/src/go14"
GOTOOLDIR="/home/water/src/go14/pkg/tool/freebsd_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0"
CXX="clang++"
CGO_ENABLED="0"

What did you do?

RUN ./src/all.bash to build the latest version of GO

[water@eid01dev ~/src/go_1g3/src]$ ./all.bash
Building Go cmd/dist using /home/water/src/go14. (go1.4-bootstrap-20170531 freebsd/amd64)
Building Go toolchain1 using /home/water/src/go14.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
./make.bash: line 215: 969 Killed ./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@"

What did you expect to see?

Successfully build the latest version of GO.

What did you see instead?

Process killed with SWAP of 2GB.

[water@eid01dev ~/src/go_1g3/src]$ dmesg
pid 1434 (compile), jid 0, uid 500, was killed: out of swap space
pid 969 (dist), jid 0, uid 500, was killed: out of swap space
pid 1270 (go_bootstrap), jid 0, uid 500, was killed: out of swap space

[water@eid01dev ~/src/go_1g3/src]$ top
last pid: 1465; load averages: 0.56, 0.64, 0.39 up 0+00:10:08 15:53:03
21 processes: 1 running, 20 sleeping
CPU: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle
Mem: 14M Active, 14M Inact, 68K Laundry, 92M Wired, 54M Buf, 339M Free
Swap: 2048M Total, 12M Used, 2036M Free

[water@eid01dev ~/src/go_1g3/src]$ swapctl -l
Device: 1024-blocks Used:
/dev/md99 2097152 12012

@nerotiger
Copy link
Author

nerotiger commented Apr 25, 2021

go build cmd/compile/internal/ssa: /home/water/src/go_1g3/pkg/tool/freebsd_amd64/compile: signal: killed

same with go1.14.2 freebsd/amd64 bootstrap.

@cherrymui
Copy link
Member

How many CPU cores do you have on your machine? Maybe set GOMAXPROCS=1 to limit the parallelism?

339M Free

This is really too small to build Go toolchain. It might work with sufficient swap space, but it will put a lot of pressure on swap and probably very slow.

@cherrymui cherrymui added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Apr 26, 2021
@nerotiger
Copy link
Author

nerotiger commented Apr 26, 2021

How many CPU cores do you have on your machine? Maybe set GOMAXPROCS=1 to limit the parallelism?

XEN: Hypervisor version 4.2 detected.
CPU: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz (2400.04-MHz K8-class CPU)

1 core, in this case. but I don't think 2 cores will help. I will try for non-paralyzed tonight.

339M Free

Hypervisor: Origin = "XenVMMXenVMM"
real memory  = 536870912 (512 MB)
avail memory = 478728192 (456 MB)

This is really too small to build Go toolchain. It might work with sufficient swap space, but it will put a lot of pressure on swap and probably very slow.

I have freed up to 2GB of swap, however the process was killed.
So what is the official minimum memory requirement for GO to compile?
This amazon cloud service served apache2.2 and mysql8 quite smoothly.
And it can run go1.14.2 (built binary) without any problem.

@cherrymui
Copy link
Member

So what is the official minimum memory requirement for GO to compile?

I vaguely remember it was mentioned somewhere but I couldn't find it. Maybe @ianlancetaylor @davecheney could provide a better answer.

And it can run go1.14.2 (built binary) without any problem.

Yes, running compiled Go programs are okay. It just needs more memory to build the toolchain itself (make.bash or all.bash).

@nerotiger
Copy link
Author

nerotiger commented Apr 26, 2021

So what is the official minimum memory requirement for GO to compile?

I vaguely remember it was mentioned somewhere but I couldn't find it. Maybe @ianlancetaylor @davecheney could provide a better answer.

And it can run go1.14.2 (built binary) without any problem.

Yes, running compiled Go programs are okay. It just needs more memory to build the toolchain itself (make.bash or all.bash).

I never realized a programming language, is so picky and required those many resources.
I'll have to just stick to 1.4 c-complied version for basic features then.

@cherrymui
Copy link
Member

I never realized a programming language, is so picky and required those many resources.

Have you tried to compile a C toolchain from source, like GCC or LLVM on that machine ?

@nerotiger
Copy link
Author

Have you tried to compile a C toolchain from source, like GCC or LLVM on that machine ?

Yes, go1.4 (bootstrap) worked just fine. // go1.4-bootstrap-20171003.tar.gz

@networkimprov
Copy link

I recall seeing a problem with Go on FreeBSD 12.1 that was fixed by upgrading to 12.2. I don't have a reference.

@nerotiger
Copy link
Author

nerotiger commented May 16, 2021 via email

@seankhliao seankhliao changed the title freebsd12.1 - go1.16.3 - build failed - out of memory all.bash: freebsd12.1 - go1.16.3 - build failed - out of memory Jun 18, 2021
@seankhliao
Copy link
Member

Closing as not a bug

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2022
@golang golang locked and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants