ondrajz / go-callvis

Visualize call graph of a Go program using Graphviz

Home Page:https://ofabry.github.io/go-callvis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

internal error in pointer analysis: runtime error: invalid memory address or nil pointer dereference

agpai2 opened this issue · comments

I am unable to generate visualizations using this package. I always end up getting this or a similar panic error. Any advice on how this can be resolved?

Internal panic in pointer analysis:
goroutine 1 [running]:
runtime/debug.Stack()
        /opt/homebrew/Cellar/go/1.22.1/libexec/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
        /opt/homebrew/Cellar/go/1.22.1/libexec/src/runtime/debug/stack.go:16 +0x1c
golang.org/x/tools/go/pointer.Analyze.func1()
        /Users/<user_id>/go/pkg/mod/golang.org/x/tools/go/pointer@v0.1.0-deprecated/analysis.go:225 +0xc0
panic({0x100d785a0?, 0x1011417c0?})
        /opt/homebrew/Cellar/go/1.22.1/libexec/src/runtime/panic.go:770 +0x124
golang.org/x/tools/go/ssa.(*Function).Type(0x100d73b80?)
        /Users/<user_id>/go/pkg/mod/golang.org/x/tools@v0.20.0/go/ssa/ssa.go:1523
golang.org/x/tools/go/pointer.(*analysis).valueNode(0x14060556000, {0x100e1b088, 0x0})
        /Users/<user_id>/go/pkg/mod/golang.org/x/tools/go/pointer@v0.1.0-deprecated/gen.go:234 +0xa8
golang.org/x/tools/go/pointer.(*analysis).genMethodsOf(0x14060556000, {0x100e153a0, 0x1401e820a80})
        /Users/<user_id>/go/pkg/mod/golang.org/x/tools/go/pointer@v0.1.0-deprecated/gen.go:1297 +0xd8
golang.org/x/tools/go/pointer.(*analysis).generate(0x14060556000)
        /Users/<user_id>/go/pkg/mod/golang.org/x/tools/go/pointer@v0.1.0-deprecated/gen.go:1336 +0x268
golang.org/x/tools/go/pointer.Analyze(0x1406054def0)
        /Users/<user_id>i/go/pkg/mod/golang.org/x/tools/go/pointer@v0.1.0-deprecated/analysis.go:290 +0x9a0
main.(*analysis).DoAnalysis(0x140000a49c0, {0x100c0508e, 0x7}, {0x0, 0x0}, 0x0, {0x140000320f0, 0x1, 0x1})
        /Users/<user_id>/go/pkg/mod/github.com/ofabry/go-callvis@v0.7.0/analysis.go:129 +0x4d8
main.main()
        /Users/<user_id>i/go/pkg/mod/github.com/ofabry/go-callvis@v0.7.0/main.go:145 +0x270