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: -gcflags='all=-N -l'" with Delve and large functions causes compiler error: bvbulkalloc too big #29829

Closed
crimsonalucard opened this Issue Jan 19, 2019 · 6 comments

Comments

Projects
None yet
4 participants
@crimsonalucard
Copy link

crimsonalucard commented Jan 19, 2019

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

$ go version
`go version go1.12beta2 darwin/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
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/brianyeh/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/brianyeh/.gvm/pkgsets/go1.12beta2/global"
GOPROXY=""
GORACE=""
GOROOT="/Users/brianyeh/.gvm/gos/go1.12beta2"
GOTMPDIR=""
GOTOOLDIR="/Users/brianyeh/.gvm/gos/go1.12beta2/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/yn/cq2yhbbd2hx0w17rhtbqd_lh0000gn/T/go-build792381837=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

ran
go build -gcflags='all=-N -l'
when I run "go build" it works but the above breaks.
Unfortunately I can't provide source code. It's closed source.

What did you expect to see?

A binary executable.

What did you see instead?

Compiler hangs for 30 minutes before exiting with this error:

# github.com/parsable/mothership/vendor/github.com/parsable/thrift-api/v1/thrift_metadata
<autogenerated>:1: internal compiler error: bvbulkalloc too big: nbit=39417 count=567595 nword=1232 siz
e=699277040
@crimsonalucard

This comment has been minimized.

Copy link
Author

crimsonalucard commented Jan 19, 2019

I'll try to reproduce the program as a smaller version later, but this is really hard to determine as the project is really large... for now this is all I got... perhaps you guys have some insight?

@agnivade

This comment has been minimized.

Copy link
Member

agnivade commented Jan 19, 2019

Does it work with 1.11.4 ?

@ALTree

This comment has been minimized.

Copy link
Member

ALTree commented Jan 19, 2019

AFAIK this is likely to be caused by an old and known compiler issue related to liveliness analysis.

If you have a really big map literal in your code (possibly auto-generated), that's likely to be the culprit.

I've also encountered this crash while fuzzing the compiler on -N -l with really big functions (>1000s lines) with many many variables in them.

@crimsonalucard

This comment has been minimized.

Copy link
Author

crimsonalucard commented Jan 19, 2019

@agnivade same error with 1.11.4. I moved to beta to see if it was fixed. Seems related to the issues below so I moved to beta to see if there was a fix.

#26560
#26552
issue 26552 says that the fix is getting punted to 1.13

You guys know about a temporary fix in the mean time?

@ALTree

This comment has been minimized.

Copy link
Member

ALTree commented Jan 19, 2019

You guys know about a temporary fix in the mean time?

See #26560 (comment)

[...] you might try reorganizing your code. Use a slice as the underlying data structure and copy it into a map in an init function. Presumably that code is autogenerated so it might require only a small change to the generator.

@odeke-em odeke-em changed the title go compiler when used with delve or "go build -gcflags='all=-N -l'"produces an error. cmd/compile: -gcflags='all=-N -l'" with Delve and large functions causes compiler error: bvbulkalloc too big Jan 22, 2019

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Feb 22, 2019

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment