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 compiler error: NewBulk too big" while running a program with dlv #56120

Open
sufiyan-techp opened this issue Oct 10, 2022 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@sufiyan-techp
Copy link

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

$ go version
go version go1.19.2 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
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/sufiyan/Library/Caches/go-build"
GOENV="/Users/sufiyan/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS="-mod=vendor"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/sufiyan/Workspace/Go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/sufiyan/Workspace/Go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.19.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/sufiyan/Workspace/Go/src/github.com/cdktf-poc/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/cm/lqydsrqj7b3cl_01bqz8048c0000gn/T/go-build1841126309=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

dlv debug main.go

Minimal program:
https://github.com/sufiyan-techp/cdktf-poc

dlv debug main.go

PS: go build/run work successfully.

What did you expect to see?

The program starts in debug mode successfully.

What did you see instead?

github.com/hashicorp/cdktf-provider-aws-go/aws/v9/ec2
<autogenerated>:1: internal compiler error: NewBulk too big: nbit=45718 count=439306 nword=1429 size=627768274

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
exit status 2
@randall77
Copy link
Contributor

When I try to load https://github.com/sufiyan-techp/cdktf-poc/tree/main/vendor/github.com/hashicorp/cdktf-provider-aws-go/aws/v9 , I get the warning "Sorry, we had to truncate this directory to 1,000 files. 1,158 entries were omitted from the list.". Similarly with the ec2 subdirectory, even worse with the ec2/ec2.go file, which is 2MB+ and github won't show it.

So, there's some really big stuff in this program. I'm not terribly surprised that we get this error, which is basically saying that the # of variables * # of safe points in a function is more than 2^32. There may be something with -N -l (the compiler flags that dlv passes to the compiler) that push things over the edge, that we might be able to tweak. But I'm skeptical there would be anything ovbious.

A workaround would be to debug an optimized binary, that seems to at least build successfully.

@sufiyan-techp
Copy link
Author

@randall77 , thanks for the prompt reply. I am looking into building an optimized binary, do let me know if you have any other insights.

@seankhliao seankhliao changed the title "internal compiler error: NewBulk too big" while running a program with dlv cmd/compile: "internal compiler error: NewBulk too big" while running a program with dlv Oct 12, 2022
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 12, 2022
@seankhliao seankhliao added this to the Unplanned milestone Oct 12, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Oct 12, 2022
@Jeet007
Copy link

Jeet007 commented Apr 18, 2023

@sufiyan-techp @randall77 How would we debug the optimized binary with delve? I am running into same issue while using cdktf go bindings for Datadog provide and this line seems to be the issue: github.com/cdktf/cdktf-provider-datadog-go/datadog/v5/dashboard. This makes it difficult to work with Go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants