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: crash in make running generic code [1.18 backport] #52311

Open
mier85 opened this issue Apr 12, 2022 · 4 comments
Open

cmd/compile: crash in make running generic code [1.18 backport] #52311

mier85 opened this issue Apr 12, 2022 · 4 comments
Labels
CherryPickCandidate NeedsInvestigation
Milestone

Comments

@mier85
Copy link

@mier85 mier85 commented Apr 12, 2022

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

go version go1.18 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/mier85/.cache/go-build"
GOENV="/home/mier85/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/mier85/go/pkg/mod"
GONOPROXY=
GONOSUMDB=
GOOS="linux"
GOPATH="/home/mier85/go"
GOPRIVATE=
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2488678595=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://go.dev/play/p/ys1JxRrYwce

What did you expect to see?

=== RUN   TestRunner
=== RUN   TestRunner/#00
[]string{"blubb"}--- PASS: TestRunner (0.00s)
    --- PASS: TestRunner/#00 (0.00s)
PASS

What did you see instead?

=== RUN   TestRunner
=== RUN   TestRunner/#00
--- FAIL: TestRunner (0.00s)
    --- FAIL: TestRunner/#00 (0.00s)
panic: runtime error: makeslice: cap out of range [recovered]
	panic: runtime error: makeslice: cap out of range

goroutine 19 [running]:
testing.tRunner.func1.2({0x4bf6a0, 0x4f7f00})
	/usr/local/go-faketime/src/testing/testing.go:1389 +0x24e
testing.tRunner.func1()
	/usr/local/go-faketime/src/testing/testing.go:1392 +0x39f
panic({0x4bf6a0, 0x4f7f00})
	/usr/local/go-faketime/src/runtime/panic.go:838 +0x207
strconv.appendQuotedWith({0xc0000a2c98, 0x0, 0x45b5d9?}, {0x2e676e6974736574, 0x72656e6e755274}, 0x22, 0x85?, 0x50?)
	/usr/local/go-faketime/src/strconv/quote.go:35 +0x86
strconv.AppendQuote(...)
	/usr/local/go-faketime/src/strconv/quote.go:135
fmt.(*fmt).fmtQ(0xc0000a2c70, {0x2e676e6974736574, 0x4bba80?})
	/usr/local/go-faketime/src/fmt/format.go:457 +0xe8
fmt.(*pp).fmtString(0x4bba80?, {0x2e676e6974736574?, 0x0?}, 0x0?)
	/usr/local/go-faketime/src/fmt/print.go:441 +0x7b
fmt.(*pp).printValue(0xc0000a2c30, {0x4bba80?, 0x508561?, 0x0?}, 0x76, 0x1)
	/usr/local/go-faketime/src/fmt/print.go:757 +0xf32
fmt.(*pp).printValue(0xc0000a2c30, {0x4ba400?, 0xc0000ac0a8?, 0x4aba33?}, 0x76, 0x0)
	/usr/local/go-faketime/src/fmt/print.go:856 +0x1615
fmt.(*pp).printArg(0xc0000a2c30, {0x4ba400?, 0xc0000ac0a8}, 0x76)
	/usr/local/go-faketime/src/fmt/print.go:712 +0x74c
fmt.(*pp).doPrintf(0xc0000a2c30, {0x4d2be5, 0x3}, {0xc000093f08?, 0x1, 0x1})
	/usr/local/go-faketime/src/fmt/print.go:1026 +0x288
fmt.Fprintf({0x4f8308, 0xc0000b2008}, {0x4d2be5, 0x3}, {0xc000038708, 0x1, 0x1})
	/usr/local/go-faketime/src/fmt/print.go:204 +0x75
fmt.Printf(...)
	/usr/local/go-faketime/src/fmt/print.go:213
main.Fixture.Run(...)
	/tmp/sandbox3516507230/prog.go:34
testing.tRunner(0xc000083040, 0xc0000ac078)
	/usr/local/go-faketime/src/testing/testing.go:1439 +0x102
created by testing.(*T).Run
	/usr/local/go-faketime/src/testing/testing.go:1486 +0x35f

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 12, 2022

This test works on tip, fails on Go 1.18 branch. A git bisect suggests that it was fixed by https://go.dev/cl/395594 which reverted https://go.dev/cl/378178. I'm not sure whether we should backport 395594 to the 1.18 branch.

CC @randall77

@ianlancetaylor ianlancetaylor changed the title testing + generics: issue with tRunner when running a generic cmd/compile: crash in make running generic code Apr 12, 2022
@ianlancetaylor ianlancetaylor added NeedsInvestigation CherryPickCandidate labels Apr 12, 2022
@ianlancetaylor ianlancetaylor added this to the Go1.18.2 milestone Apr 12, 2022
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Apr 12, 2022

Since this is fixed on tip, I'm marking this as a cherry pick candidate for 1.18.

@heschi heschi removed this from the Go1.18.2 milestone May 10, 2022
@heschi heschi added this to the Go1.18.3 milestone May 10, 2022
@heschi
Copy link
Contributor

@heschi heschi commented May 11, 2022

@dmitshur dmitshur changed the title cmd/compile: crash in make running generic code cmd/compile: crash in make running generic code [1.18 backport] May 11, 2022
@toothrot
Copy link
Contributor

@toothrot toothrot commented May 25, 2022

Any updates on this issue? @randall77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickCandidate NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

4 participants