Skip to content

cmd/compile: -gcflags='all=-N -l'" with Delve and large functions causes compiler error: bvbulkalloc too big #29829

Closed

Description

@pyrofolium

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

Activity

  1. pyrofolium commented on Jan 19, 2019

    @pyrofolium
    Author

    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?

  2. agnivade commented on Jan 19, 2019

    @agnivade
    Contributor

    Does it work with 1.11.4 ?

  3. ALTree commented on Jan 19, 2019

    @ALTree
    Member

    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.

  4. pyrofolium commented on Jan 19, 2019

    @pyrofolium
    Author

    @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?

  5. ALTree commented on Jan 19, 2019

    @ALTree
    Member

    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.

  6. added
    WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
    on Jan 22, 2019
  7. 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[/+] on Jan 22, 2019
  8. gopherbot commented on Feb 22, 2019

    @gopherbot
    Contributor

    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.)

  9. locked and limited conversation to collaborators on Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions