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/go: panic in work.WriteCoverMetaFilesFile for "go test -n -cover" in root src dir #67953

Closed
thanm opened this issue Jun 12, 2024 · 2 comments
Assignees
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@thanm
Copy link
Contributor

thanm commented Jun 12, 2024

On tip, I accidentally ran this command below in the root source directory (instead of a subdir).

$ cd `go env GOROOT`
$ cd src
$ go test -n -coverpkg=internal/coverage/decodecounter ./...

This should succeed, but instead I got this crash:

...
/w/go.master/pkg/tool/linux_amd64/compile -o $WORK/b2278/_pkg_.a -trimpath "$WORK/b2278=>" -p time/tzdata -std -complete -buildid kQeKaOUArGGmE6IQy2SI/kQeKaOUArGGmE6IQy2SI -c=4 -nolocalimports -importcfg $WORK/b2278/importcfg -pack ./time/tzdata/tzdata.go ./time/tzdata/zzipdata.go
/w/go.master/pkg/tool/linux_amd64/buildid -w $WORK/b2278/_pkg_.a # internal
panic: unexpected mode built-in package

goroutine 2504 [running]:
cmd/go/internal/work.WriteCoverMetaFilesFile(0xc001d92330?, {0x2f?, 0x0?}, 0xc000d0ef20)
	/w/go.master/src/cmd/go/internal/work/cover.go:116 +0x4a7
cmd/go/internal/work.ActorFunc.Act(0xc17ab8?, 0xfefb20?, {0xc17ab8?, 0xfefb20?}, 0xc00292df10?)
	/w/go.master/src/cmd/go/internal/work/action.go:76 +0x2d
cmd/go/internal/work.(*Builder).Do.func3({0xc17ab8, 0xfefb20}, 0xc000d0ef20)
	/w/go.master/src/cmd/go/internal/work/exec.go:152 +0x7a4
cmd/go/internal/work.(*Builder).Do.func4()
	/w/go.master/src/cmd/go/internal/work/exec.go:221 +0xae
created by cmd/go/internal/work.(*Builder).Do in goroutine 1
	/w/go.master/src/cmd/go/internal/work/exec.go:207 +0x3d1

What appears to be happening is that work.WriteCoverMetaFilesFile isn't properly handling dummy/builtin packages such as "unsafe" in this particular code path.

@thanm thanm added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 12, 2024
@thanm thanm added this to the Go1.23 milestone Jun 12, 2024
@thanm thanm self-assigned this Jun 12, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/592202 mentions this issue: cmd/go: fix handling of builtin packages in WriteCoverMetaFilesFile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants