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

cmd/compile/internal/ssa: out of memory error when boostrapping 1.12 #30981

Open
Eintler opened this Issue Mar 21, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@Eintler
Copy link

Eintler commented Mar 21, 2019

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

1.12.1

Does this issue reproduce with the latest release?

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/.golang/path"
GOPROXY=""
GORACE=""
GOROOT="/root/.golang/go"
GOTMPDIR=""
GOTOOLDIR="/root/.golang/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
GOMOD="/root/.golang/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build589816395=/tmp/go-build -gno-record-gcc-switches"

What did you do?

cd src
./all.bash
# cmd/compile/internal/ssa [cmd/compile/internal/ssa.test]
fatal error: runtime: out of memory

runtime stack:
runtime.throw(0xe97414, 0x16)
	/root/.golang/go/src/runtime/panic.go:714 +0x72
runtime.sysMap(0xc04c000000, 0x4000000, 0x1720818)
	/root/.golang/go/src/runtime/mem_linux.go:170 +0xc7
runtime.(*mheap).sysAlloc(0x16f8980, 0x2000, 0x16f8990, 0x1)
	/root/.golang/go/src/runtime/malloc.go:633 +0x1cd
runtime.(*mheap).grow(0x16f8980, 0x1, 0x0)
	/root/.golang/go/src/runtime/mheap.go:1232 +0x42
runtime.(*mheap).allocSpanLocked(0x16f8980, 0x1, 0x1720828, 0xc000021320)
	/root/.golang/go/src/runtime/mheap.go:1150 +0x3a7
runtime.(*mheap).alloc_m(0x16f8980, 0x1, 0xc00004004b, 0x458beb)
	/root/.golang/go/src/runtime/mheap.go:977 +0xc2
runtime.(*mheap).alloc.func1()
	/root/.golang/go/src/runtime/mheap.go:1048 +0x4c
runtime.systemstack(0x0)
	/root/.golang/go/src/runtime/asm_amd64.s:351 +0x66
runtime.mstart()
	/root/.golang/go/src/runtime/proc.go:1153

goroutine 102 [running]:
runtime.systemstack_switch()
	/root/.golang/go/src/runtime/asm_amd64.s:311 fp=0xc0325f1780 sp=0xc0325f1778 pc=0x45a650
runtime.(*mheap).alloc(0x16f8980, 0x1, 0x1004b, 0x0)
	/root/.golang/go/src/runtime/mheap.go:1047 +0x8a fp=0xc0325f17d0 sp=0xc0325f1780 pc=0x42477a
runtime.(*mcentral).grow(0x16f9fc0, 0x0)
	/root/.golang/go/src/runtime/mcentral.go:255 +0x7d fp=0xc0325f1810 sp=0xc0325f17d0 pc=0x4175fd
runtime.(*mcentral).cacheSpan(0x16f9fc0, 0x203000)
	/root/.golang/go/src/runtime/mcentral.go:106 +0x2ff fp=0xc0325f1870 sp=0xc0325f1810 pc=0x41711f
runtime.(*mcache).refill(0x7fc471e28008, 0x4b)
	/root/.golang/go/src/runtime/mcache.go:135 +0x85 fp=0xc0325f1890 sp=0xc0325f1870 pc=0x416bb5
runtime.(*mcache).nextFree(0x7fc471e28008, 0x44b, 0x0, 0x561b4b379157, 0x203012)
	/root/.golang/go/src/runtime/malloc.go:786 +0x87 fp=0xc0325f18c8 sp=0xc0325f1890 pc=0x40b9c7
runtime.mallocgc(0x800, 0x0, 0x200, 0xc04bef5400)
	/root/.golang/go/src/runtime/malloc.go:939 +0x765 fp=0xc0325f1968 sp=0xc0325f18c8 pc=0x40c2e5
runtime.growslice(0xe4cde0, 0xc04bef5400, 0x20, 0x20, 0x21, 0xc04bef5400, 0x10, 0x20)
	/root/.golang/go/src/runtime/slice.go:175 +0x151 fp=0xc0325f19d0 sp=0xc0325f1968 pc=0x443ca1
cmd/compile/internal/gc.scopePCs(0xc0152187e0, 0xc009e216e0, 0x3, 0x4, 0xc04be9abb0, 0x3, 0x3)
	/root/.golang/go/src/cmd/compile/internal/gc/scope.go:82 +0x119 fp=0xc0325f1a78 sp=0xc0325f19d0 pc=0xcc9e89
cmd/compile/internal/gc.assembleScopes(0xc0152187e0, 0xc00a04cc60, 0xc04bf77080, 0x9, 0x10, 0xc04bf07600, 0x9, 0x10, 0xc04bf77080, 0x9, ...)
	/root/.golang/go/src/cmd/compile/internal/gc/scope.go:37 +0x140 fp=0xc0325f1ae0 sp=0xc0325f1a78 pc=0xcc9aa0
cmd/compile/internal/gc.debuginfo(0xc0152187e0, 0xe82b60, 0xc00a04cc60, 0xe8be2e, 0x8, 0xeb0800, 0x0, 0x0, 0x7fc471e28008)
	/root/.golang/go/src/cmd/compile/internal/gc/pgen.go:443 +0x6ab fp=0xc0325f1c30 sp=0xc0325f1ae0 pc=0xca5cdb
cmd/internal/obj.(*Link).populateDWARF(0xc0000b03c0, 0xe82b60, 0xc00a04cc60, 0xc0152187e0, 0x7fff38604520, 0x18)
	/root/.golang/go/src/cmd/internal/obj/objfile.go:569 +0x621 fp=0xc0325f1dc0 sp=0xc0325f1c30 pc=0x50ba71
cmd/internal/obj.Flushplist(0xc0000b03c0, 0xc0325f1ec0, 0xc04bfac160, 0x7fff38604520, 0x18)
	/root/.golang/go/src/cmd/internal/obj/plist.go:109 +0x798 fp=0xc0325f1e98 sp=0xc0325f1dc0 pc=0x510bf8
cmd/compile/internal/gc.(*Progs).Flush(0xc04bf72ee0)
	/root/.golang/go/src/cmd/compile/internal/gc/gsubr.go:93 +0xbc fp=0xc0325f1ee8 sp=0xc0325f1e98 pc=0xc5b38c
cmd/compile/internal/gc.compileSSA(0xc00a04cc60, 0x1)
	/root/.golang/go/src/cmd/compile/internal/gc/pgen.go:322 +0x689 fp=0xc0325f1f98 sp=0xc0325f1ee8 pc=0xca51c9
cmd/compile/internal/gc.compileFunctions.func2(0xc005343620, 0xc005231cb0, 0x1)
	/root/.golang/go/src/cmd/compile/internal/gc/pgen.go:362 +0x49 fp=0xc0325f1fc8 sp=0xc0325f1f98 pc=0xd69e09
runtime.goexit()
	/root/.golang/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc0325f1fd0 sp=0xc0325f1fc8 pc=0x45c5a1
created by cmd/compile/internal/gc.compileFunctions
	/root/.golang/go/src/cmd/compile/internal/gc/pgen.go:360 +0x129

goroutine 1 [runnable]:
cmd/compile/internal/gc.compileFunctions()
	/root/.golang/go/src/cmd/compile/internal/gc/pgen.go:368 +0x17d
cmd/compile/internal/gc.Main(0xeaff68)
	/root/.golang/go/src/cmd/compile/internal/gc/main.go:675 +0x3153
main.main()
	/root/.golang/go/src/cmd/compile/main.go:51 +0xad

goroutine 101 [runnable]:
cmd/compile/internal/ssa.(*edgeState).processDest(0xc032a81738, 0x1039ea0, 0x1682ee0, 0x43, 0x0, 0x17f414200000033, 0x0)
	/root/.golang/go/src/cmd/compile/internal/ssa/regalloc.go:2023 +0xebb
cmd/compile/internal/ssa.(*edgeState).process(0xc032a81738)
	/root/.golang/go/src/cmd/compile/internal/ssa/regalloc.go:1956 +0x115
cmd/compile/internal/ssa.(*regAllocState).shuffle(0xc04bfe8780, 0xc04bfe9080, 0xf, 0xf)
	/root/.golang/go/src/cmd/compile/internal/ssa/regalloc.go:1836 +0x23b
cmd/compile/internal/ssa.(*regAllocState).regalloc(0xc04bfe8780, 0xc04beef760)
	/root/.golang/go/src/cmd/compile/internal/ssa/regalloc.go:1647 +0x6e58
cmd/compile/internal/ssa.regalloc(0xc04beef760)
	/root/.golang/go/src/cmd/compile/internal/ssa/regalloc.go:146 +0x62
cmd/compile/internal/ssa.Compile(0xc04beef760)
	/root/.golang/go/src/cmd/compile/internal/ssa/compile.go:90 +0x479
cmd/compile/internal/gc.buildssa(0xc009fcf8c0, 0x0, 0x0)
	/root/.golang/go/src/cmd/compile/internal/gc/ssa.go:288 +0xbfd
cmd/compile/internal/gc.compileSSA(0xc009fcf8c0, 0x0)
	/root/.golang/go/src/cmd/compile/internal/gc/pgen.go:297 +0x4d
cmd/compile/internal/gc.compileFunctions.func2(0xc005343620, 0xc005231cb0, 0x0)
	/root/.golang/go/src/cmd/compile/internal/gc/pgen.go:362 +0x49
created by cmd/compile/internal/gc.compileFunctions
	/root/.golang/go/src/cmd/compile/internal/gc/pgen.go:360 +0x129
FAIL	cmd/compile/internal/ssa [build failed]

What did you expect to see?

build successfully

Thanks :)

@ALTree

This comment has been minimized.

Copy link
Member

ALTree commented Mar 21, 2019

Lately I've also seen this happening on the arm builder, e.g.

https://build.golang.org/log/480639da6bca35d68f3f468e74595600608c21ea

My guess is that compiler changes introduced during the 1.12 cycle made it require more memory to be compiled.

I assume you could build Go1.11, on the same machine, with no issues... is that correct?

@ALTree ALTree added this to the Go1.13 milestone Mar 21, 2019

@ALTree ALTree changed the title 1.12.1 cmd/compile/internal/ssa [build failed] cmd/compile/internal/ssa: out of memory error when boostrapping 1.12 Mar 21, 2019

@josharian

This comment has been minimized.

Copy link
Contributor

josharian commented Mar 21, 2019

Possible dup of #27739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.