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

internal compiler error #46153

Closed
d2k opened this issue May 13, 2021 · 1 comment
Closed

internal compiler error #46153

d2k opened this issue May 13, 2021 · 1 comment

Comments

@d2k
Copy link

d2k commented May 13, 2021

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

$ go version
go version go1.16 windows/amd64

Does this issue reproduce with the latest release?

Yes

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

set GO111MODULE=auto
set GOARCH=amd64
set GOBIN=C:\Users\PII\go\bin
set GOCACHE=C:\Users\PII\AppData\Local\go-build
set GOENV=C:\Users\PII\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\PII\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\PII\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\PII\go\go1.16
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\PII\go\go1.16\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.16
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\ULRICH~1\AppData\Local\Temp\go-build3970485863=/tmp/go-build -gno-record-gcc-switches

go env Output
$ go env

What did you do?

I wanted to test out the boundaries of in memory hashmaps for fast rule based parameters. I used python to generate a 200MB map[string][]float32 which I wanted to compile. Durring the compile the error message:

go build getMargin.go

github.com/d2k/marginTests/src/util/marginMap

util\marginMap\marginMap.go:100015:5: internal compiler error: bvbulkalloc too big: nbit=100001 count=2100028 nword=3126 size=6564687528

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

came back

Use the following python code to generate any kind of numbers

import datetime
import time
if name == 'main':

numOfHotels = 100000
numOfDays = 365

basedate = datetime.datetime.utcnow().date()
print(int(time.mktime(basedate.timetuple())))

a = list()
for i in range(numOfDays):

    margin = i + i / 1000
    a.append(f"{margin}")
margin = "[]float32{"+",".join(a)+"}"
with open(f"C:\\Users\\Ulrich Arndt\\go\\src\\github.com\\d2k\\marginTests\\src\\util\\marginMap\\marginMap.go","w") as f:
    f.write('''

package marginMap

type HM map[string][]float32

var HotelMargins = HM{
''')
for i in range(numOfHotels):
hotel = f' "hotel{(i+1):07d}": {margin} ,\n'
f.write(hotel)
if i % 1000 == 0:
print(i)
f.write("}\n")

    txt = '''

type M struct {
BaseDate int64
NumberOfDays int32
HotelMargins HM
}
var Margins = M{
'''
f.write(txt)
f.write(f" {int(time.mktime(basedate.timetuple()))},\n")
f.write(f" {numOfDays},\n")
f.write(f" HotelMargins,\n")
f.write("}\n")

The main go code is:

package main

import (
"github.com/d2k/marginTests/src/util/marginMap"
)

func main() {

println(marginMap.Margins.HotelMargins["hotel0000002"][5]/1000)

}

What did you expect to see?

I compliled exe file with would print the right value

What did you see instead?

see above - comipler error

marginTests.zip

@ALTree
Copy link
Member

ALTree commented May 13, 2021

Thanks for the report, this is a dup of #33437. I'm closing here in favour of that older thread.

@ALTree ALTree closed this as completed May 13, 2021
@golang golang locked and limited conversation to collaborators May 13, 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

3 participants