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 go list -e -compiled when cgo fails #60608

Closed
dominikh opened this issue Jun 5, 2023 · 2 comments
Closed

cmd/go: panic in go list -e -compiled when cgo fails #60608

dominikh opened this issue Jun 5, 2023 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@dominikh
Copy link
Member

dominikh commented Jun 5, 2023

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

$ go version
go version devel go1.21-d8c9eece28 Mon Jun 5 17:00:46 2023 +0000 linux/amd64

Does this issue reproduce with the latest release?

No

What did you do?

Run the following steps in an environment where cgo compilation fails, for example because pkg-config exits non-zero:

$ curl https://go.dev/play/p/cNL1boxt5tp.go | txtar -extract
$ go mod tidy
$ go list -e -compiled

What did you expect to see?

No panic.

What did you see instead?

panic: runtime error: index out of range [-1]

goroutine 1 [running]:
cmd/go/internal/list.collectDepsErrors.func1(0xc00032c2d0?, 0xc000854fd0?)
	/home/dominikh/prj/go/src/cmd/go/internal/list/list.go:952 +0xa7
sort.insertionSort_func({0xc0008550f0?, 0xc000702260?}, 0x0, 0x2)
	/home/dominikh/prj/go/src/sort/zsortfunc.go:12 +0xa7
sort.pdqsort_func({0xc0008550f0?, 0xc000702260?}, 0x7f078c2075b8?, 0x18?, 0xc000780000?)
	/home/dominikh/prj/go/src/sort/zsortfunc.go:73 +0x31b
sort.Slice({0x9a7e40?, 0xc00032c2d0?}, 0x2?)
	/home/dominikh/prj/go/src/sort/slice.go:26 +0xf6
cmd/go/internal/list.collectDepsErrors(0xc000025800)
	/home/dominikh/prj/go/src/cmd/go/internal/list/list.go:950 +0x2fe
cmd/go/internal/list.runList({0xb7f318?, 0xf1c660}, 0xee0760?, {0xc000132070?, 0x0, 0x0})
	/home/dominikh/prj/go/src/cmd/go/internal/list/list.go:806 +0x2186
main.invoke(0xee0760, {0xc000132050, 0x3, 0x3})
	/home/dominikh/prj/go/src/cmd/go/main.go:244 +0x5f1
main.main()
	/home/dominikh/prj/go/src/cmd/go/main.go:184 +0x7cf

Trying to build the package with go build fails gracefully:

go build gioui.org/app/internal/xkb:
# pkg-config --cflags  -- xkbcommon
pkg-config: exec: "pkg-config": executable file not found in $PATH
go build gioui.org/internal/vk:
# pkg-config --cflags  -- wayland-client
pkg-config: exec: "pkg-config": executable file not found in $PATH
@dr2chase
Copy link
Contributor

dr2chase commented Jun 6, 2023

@bcmills @ianlancetaylor

@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 6, 2023
@bcmills
Copy link
Contributor

bcmills commented Jun 7, 2023

Duplicate of #59905

@bcmills bcmills marked this as a duplicate of #59905 Jun 7, 2023
@bcmills bcmills closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2023
@golang golang locked and limited conversation to collaborators Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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

4 participants