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/go: internal compiler error: NewBulk too big: nbit=66729 count=934227 nword=2086 size=1948797522 #48375

Closed
sfqsfq opened this issue Sep 14, 2021 · 2 comments

Comments

@sfqsfq
Copy link

sfqsfq commented Sep 14, 2021

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

$ go version
go version go1.17.1 windows/amd64

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
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\sfq\AppData\Local\go-build
set GOENV=C:\Users\sfq\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\sfq\Documents\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\sfq\Documents\go
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.17.1
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\sfq\Desktop\qqqqq\id-validator\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\sfq\AppData\Local\Temp\go-build7276215=/tmp/go-build -gno-record-gcc-switches
GOROOT/bin/go version: go version go1.17.1 windows/amd64
GOROOT/bin/go tool compile -V: compile version go1.17.1
gdb --version: GNU gdb (GDB) 8.1

What did you do?

git clone go get -u github.com/guanguans/id-validator
go build -gcflags "all=-N -l" github.com/guanguans/id-validator/examples

When I use go version go1.15 windows/amd64,it eats up all my system's memory.
When I change to go version go1.17.1 windows/amd64, It takes a long time to compile, and print out the below information.

PS C:\Users\sfq\Desktop\qqqqq\id-validator> go build  -gcflags "all=-N -l" github.com/guanguans/id-validator/examples
# github.com/guanguans/id-validator/data
data\constellation.go:60:6: internal compiler error: NewBulk too big: nbit=66729 count=934227 nword=2086 size=1948797522

Please file a bug report including a short program that triggers the error.
https://golang.org/issue/new

What did you expect to see?

Compile successfully

What did you see instead?

PS C:\Users\sfq\Desktop\qqqqq\id-validator> go build  -gcflags "all=-N -l" github.com/guanguans/id-validator/examples
# github.com/guanguans/id-validator/data
data\constellation.go:60:6: internal compiler error: NewBulk too big: nbit=66729 count=934227 nword=2086 size=1948797522

Please file a bug report including a short program that triggers the error.
https://golang.org/issue/new
@ALTree
Copy link
Member

ALTree commented Sep 14, 2021

Thanks for reporting this.

The issue is caused by huge map literals like the ones you have in the .go files in the data folder, and I believe this is a dup of #29829 (closed) and #33437 (still open). See in particular #26560 (comment).

The reason the error message is slightly different is that in commit 0ced540 bvbulkalloc was renamed to NewBulk. So now it says "NewBulk too big" instead of "bvbulkalloc too big".

@seankhliao
Copy link
Member

Duplicate of #33437

@seankhliao seankhliao marked this as a duplicate of #33437 Sep 15, 2021
@golang golang locked and limited conversation to collaborators Sep 15, 2022
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