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

Closed
mier85 opened this issue Apr 12, 2022 · 8 comments
Closed

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

mier85 opened this issue Apr 12, 2022 · 8 comments
Labels
CherryPickCandidate Used during the release process for point releases FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mier85
Copy link

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

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 Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. CherryPickCandidate Used during the release process for point releases labels Apr 12, 2022
@ianlancetaylor ianlancetaylor added this to the Go1.18.2 milestone Apr 12, 2022
@ianlancetaylor
Copy link
Contributor

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

@heschi heschi modified the milestones: Go1.18.2, Go1.18.3 May 10, 2022
@heschi
Copy link
Contributor

heschi commented May 11, 2022

cc @mdempsky @randall77

@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

Any updates on this issue? @randall77

@dmitshur dmitshur modified the milestones: Go1.18.3, Go1.18.4 Jun 1, 2022
@gopherbot
Copy link

Change https://go.dev/cl/411120 mentions this issue: [release-branch.go1.18] Revert "cmd/compile: stop interface conversions for generic method calls from allocating"

@cherrymui
Copy link
Member

CL 395594 doesn't apply cleanly to the 1.18 branch, but the edit is small. I made https://go-review.googlesource.com/c/go/+/411120 , which does seem to fix the issue.

@randall77 what do you think? Should we backport the reverting CL? Thanks.

@joedian joedian added the CherryPickApproved Used during the release process for point releases label Jun 22, 2022
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Jun 22, 2022
@gopherbot gopherbot modified the milestones: Go1.18.4, Go1.18.5 Jul 12, 2022
@cherrymui
Copy link
Member

I think we are still unclear what the best fix it. Also, as we discussed in #53852 (comment) , we will stop backporting non-revert generics issues to 1.18, so we don't destabilize Go 1.18. Maybe we don't backport this one?

@cherrymui cherrymui added CherryPickCandidate Used during the release process for point releases and removed CherryPickApproved Used during the release process for point releases labels Jul 27, 2022
@gopherbot gopherbot modified the milestones: Go1.18.5, Go1.18.6 Aug 1, 2022
@dmitshur
Copy link
Contributor

dmitshur commented Aug 3, 2022

We've discussed this backport request. It was found that backporting individual CLs for generic fixes can cause destabilization and create new issues, so because of that risk we're not going to accept this backport candidate. This problem doesn't exist in Go 1.19 and future major Go releases.

@dmitshur dmitshur closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2022
@golang golang locked and limited conversation to collaborators Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickCandidate Used during the release process for point releases FrozenDueToAge 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

8 participants