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

go/types: panic in error reporting for invalid use of "init" [1.17 only] #48082

Closed
findleyr opened this issue Aug 30, 2021 · 4 comments
Closed
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Milestone

Comments

@findleyr
Copy link
Contributor

The fix in CL 324732 on the dev.typeparams branch should have been back-ported to 1.17, but was missed.

This can result in a panic in go/types when type checking the following invalid code

package p

import "init"

Please consider this for back-port to the next 1.17 minor release.

CC @griesemer @golang/release

@findleyr findleyr added the CherryPickCandidate Used during the release process for point releases label Aug 30, 2021
@heschi heschi added this to the Go1.17.1 milestone Aug 30, 2021
@gopherbot
Copy link

Change https://golang.org/cl/346309 mentions this issue: go/types: add a test for invalid import of "init"

gopherbot pushed a commit that referenced this issue Aug 30, 2021
This error reporting code path did not have test coverage, and panics in
1.17 (filed as #48082).

Add a test that would have reproduced the panic, for both go/types and
cmd/compile/internal/types2.

Change-Id: Icd5f54f8407e4ab57d432f44a129ecf6b2755feb
Reviewed-on: https://go-review.googlesource.com/c/go/+/346309
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
@findleyr
Copy link
Contributor Author

findleyr commented Sep 1, 2021

Though this panic should be rare, it has manifested at least once in in a vscode-go gopls crash report, and in a Google internal crash report. It is a regression, and in my opinion is worth fixing for 1.17.1. Marked as a release blocker to make sure it is not missed in any case.

@cherrymui cherrymui added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Sep 1, 2021
@gopherbot
Copy link

Change https://golang.org/cl/347071 mentions this issue: [release-branch.go1.17] go/types: fix panic with nil package name

gopherbot pushed a commit that referenced this issue Sep 1, 2021
This is a straightforward port of CL 320490 to go/types.

Fixes #48082

Change-Id: I763c806c777f926a563d8f9384764e5b3f7f083c
Reviewed-on: https://go-review.googlesource.com/c/go/+/324732
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
(cherry picked from commit e32fab1)
Reviewed-on: https://go-review.googlesource.com/c/go/+/347071
@gopherbot
Copy link

Closed by merging 678b07d to release-branch.go1.17.

@golang golang locked and limited conversation to collaborators Sep 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants