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

Panic: T for a simple programme #154

Closed
RichardoC opened this issue Mar 21, 2023 · 2 comments · Fixed by #202
Closed

Panic: T for a simple programme #154

RichardoC opened this issue Mar 21, 2023 · 2 comments · Fixed by #202
Labels

Comments

@RichardoC
Copy link

This is a very cool project, but when I tried it on one of my side projects it failed with this obscure panic

Steps to reproduce exactly. Not all steps required but it's what I did

# Running inside a container for isolation
docker run --rm -it ubuntu:22.04

apt update && apt install -y golang

apt install -y ca-certificates

# project I want to visualise
git clone github.com/RichardoC/kube-audit-rest

cd kube-audit-rest

go run github.com/ofabry/go-callvis@latest .
root@d1d19aa8cd6b:/kube-audit-rest# go run github.com/ofabry/go-callvis@latest .
panic: T

goroutine 2499 [running]:
golang.org/x/tools/go/types/typeutil.Hasher.hashFor({0xa308e0?}, {0xb8b320?, 0xc012da9c20?})
	/root/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:302 +0x41f
golang.org/x/tools/go/types/typeutil.Hasher.Hash({0xe91ec0?}, {0xb8b320, 0xc012da9c20})
	/root/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:226 +0x65
golang.org/x/tools/go/types/typeutil.Hasher.hashFor({0xa308e0?}, {0xb8b258?, 0xc012ac7620?})
	/root/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:269 +0x3f2
golang.org/x/tools/go/types/typeutil.Hasher.Hash({0xc01215cf01?}, {0xb8b258, 0xc012ac7620})
	/root/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:226 +0x65
golang.org/x/tools/go/types/typeutil.Hasher.hashTuple({0xc00027bae8?}, 0xc012a91998)
	/root/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:310 +0x5f
golang.org/x/tools/go/types/typeutil.Hasher.hashFor({0xa308e0?}, {0xb8b280?, 0xc012dbc840?})
	/root/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:276 +0x10c
golang.org/x/tools/go/types/typeutil.Hasher.Hash({0x2?}, {0xb8b280, 0xc012dbc840})
	/root/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:226 +0x65
golang.org/x/tools/go/types/typeutil.(*Map).At(0xc0125d0058, {0xb8b280, 0xc012dbc840})
	/root/go/pkg/mod/golang.org/x/[email protected]/go/types/typeutil/map.go:88 +0x48
golang.org/x/tools/go/ssa.(*Program).needMethods(0xc0125d0000, {0xb8b280?, 0xc012dbc840?}, 0x0)
	/root/go/pkg/mod/golang.org/x/[email protected]/go/ssa/methods.go:156 +0x66
golang.org/x/tools/go/ssa.(*Program).needMethodsOf(0xc0125d0000, {0xb8b280?, 0xc012dbc840?})
	/root/go/pkg/mod/golang.org/x/[email protected]/go/ssa/methods.go:145 +0x70
golang.org/x/tools/go/ssa.(*Package).build(0xc019364360)
	/root/go/pkg/mod/golang.org/x/[email protected]/go/ssa/builder.go:2275 +0x111
sync.(*Once).doSlow(0xc0001b37b8?, 0x66bcde?)
	/usr/lib/go-1.18/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
	/usr/lib/go-1.18/src/sync/once.go:59
golang.org/x/tools/go/ssa.(*Package).Build(...)
	/root/go/pkg/mod/golang.org/x/[email protected]/go/ssa/builder.go:2263
golang.org/x/tools/go/ssa.(*Program).Build.func1(0x0?)
	/root/go/pkg/mod/golang.org/x/[email protected]/go/ssa/builder.go:2247 +0x4c
created by golang.org/x/tools/go/ssa.(*Program).Build
	/root/go/pkg/mod/golang.org/x/[email protected]/go/ssa/builder.go:2246 +0x19c
exit status 2

go version

go version go1.18.1 linux/amd64

@hausliu
Copy link

hausliu commented Apr 11, 2023

Updating golang.org/x/tools to the latest version can solve this problem, but you need to compile it yourself.

@ondrajz
Copy link
Owner

ondrajz commented Jan 1, 2025

This is fixed in #202.

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

Successfully merging a pull request may close this issue.

3 participants