ondrajz / go-callvis

Visualize call graph of a Go program using Graphviz
https://ofabry.github.io/go-callvis
MIT License
5.98k stars 416 forks source link

go-callvis v0.7.0 go1.23.2 panic: runtime error: invalid memory address or nil pointer dereference [recovered] #197

Open senjixu opened 3 weeks ago

senjixu commented 3 weeks ago

GOVERSION='go1.23.2' go-callvis v0.7.0 panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1006df404]

goroutine 79 [running]: go/types.(Checker).handleBailout(0x140004b2000, 0x1400080fbb8) /usr/local/go/src/go/types/check.go:404 +0x9c panic({0x100c41a80?, 0x10108bad0?}) /usr/local/go/src/runtime/panic.go:785 +0x124 go/types.(StdSizes).Sizeof(0x0, {0x100ce4598, 0x101092a00}) /usr/local/go/src/go/types/sizes.go:229 +0x314 go/types.(Config).sizeof(...) /usr/local/go/src/go/types/sizes.go:334 go/types.representableConst.func1({0x100ce4598?, 0x101092a00?}) /usr/local/go/src/go/types/const.go:77 +0x90 go/types.representableConst({0x100ce7f98, 0x101043380}, 0x140004b2000, 0x101092a00, 0x1400080de48) /usr/local/go/src/go/types/const.go:93 +0x134 go/types.(Checker).representation(0x140004b2000, 0x14000916800, 0x101092a00) /usr/local/go/src/go/types/const.go:257 +0x68 go/types.(Checker).implicitTypeAndValue(0x140004b2000, 0x14000916800, {0x100ce4598, 0x101092a00}) /usr/local/go/src/go/types/expr.go:377 +0x304 go/types.(Checker).convertUntyped(0x140004b2000, 0x14000916800, {0x100ce4598, 0x101092a00}) /usr/local/go/src/go/types/const.go:290 +0x30 go/types.(Checker).isValidIndex(0x140004b2000, 0x14000916800, 0x34, {0x100ac46fb, 0x5}, 0x0) /usr/local/go/src/go/types/index.go:384 +0x64 go/types.(Checker).index(0x140004b2000, {0x100ce6f50, 0x1400046e280}, 0xffffffffffffffff) /usr/local/go/src/go/types/index.go:355 +0x9c go/types.(Checker).builtin(0x140004b2000, 0x14000916780, 0x140004781c0, 0x9) /usr/local/go/src/go/types/builtins.go:520 +0x4014 go/types.(Checker).callExpr(0x140004b2000, 0x14000916780, 0x140004781c0) /usr/local/go/src/go/types/call.go:230 +0xb04 go/types.(Checker).exprInternal(0x140004b2000, 0x0, 0x14000916780, {0x100ce7070, 0x140004781c0}, {0x0, 0x0}) /usr/local/go/src/go/types/expr.go:1410 +0xd0 go/types.(Checker).rawExpr(0x140004b2000, 0x0, 0x14000916780, {0x100ce7070?, 0x140004781c0?}, {0x0?, 0x0?}, 0x0) /usr/local/go/src/go/types/expr.go:981 +0x120 go/types.(Checker).multiExpr(0x140004b2000, {0x100ce7070, 0x140004781c0}, 0x0) /usr/local/go/src/go/types/expr.go:1568 +0x60 go/types.(Checker).initVars(0x140004b2000, {0x1400052c2e0, 0x1, 0x1}, {0x140004640c0, 0x1, 0x1}, {0x0, 0x0}) /usr/local/go/src/go/types/assignments.go:425 +0x100 go/types.(Checker).shortVarDecl(0x140004b2000, {0x100ce22a0, 0x140001a6258}, {0x14000464090, 0x1, 0x100cac5a0?}, {0x140004640c0, 0x1, 0x1}) /usr/local/go/src/go/types/assignments.go:573 +0x65c go/types.(Checker).stmt(0x140004b2000, 0x0, {0x100ce6c20, 0x14000478200}) /usr/local/go/src/go/types/stmt.go:480 +0xce0 go/types.(Checker).stmtList(0x140004b2000, 0x0, {0x14000478300?, 0x140004b2000?, 0x100c5d520?}) /usr/local/go/src/go/types/stmt.go:121 +0x88 go/types.(Checker).funcBody(0x140004b2000, 0x100ce70a0?, {0x14000592158?, 0x1006a80ec?}, 0x1400065f4c0, 0x14000468210, {0x0?, 0x0?}) /usr/local/go/src/go/types/stmt.go:41 +0x218 go/types.(Checker).funcDecl.func1() /usr/local/go/src/go/types/decl.go:888 +0x44 go/types.(Checker).processDelayed(0x140004b2000, 0x0) /usr/local/go/src/go/types/check.go:516 +0x12c go/types.(Checker).checkFiles(0x140004b2000, {0x1400046a000, 0x1, 0x1}) /usr/local/go/src/go/types/check.go:462 +0x1b4 go/types.(Checker).Files(0x140001aa000?, {0x1400046a000?, 0x1400007e4e0?, 0x6?}) /usr/local/go/src/go/types/check.go:422 +0x80 golang.org/x/tools/go/packages.(loader).loadPackage(0x140001aa000, 0x140003c4ea0) /Users/bruce/go/pkg/mod/golang.org/x/tools@v0.8.0/go/packages/packages.go:1052 +0x858 golang.org/x/tools/go/packages.(loader).loadRecursive.func1() /Users/bruce/go/pkg/mod/golang.org/x/tools@v0.8.0/go/packages/packages.go:851 +0x178 sync.(Once).doSlow(0x0?, 0x0?) /usr/local/go/src/sync/once.go:76 +0xf8 sync.(Once).Do(...) /usr/local/go/src/sync/once.go:67 golang.org/x/tools/go/packages.(loader).loadRecursive(0x0?, 0x0?) /Users/bruce/go/pkg/mod/golang.org/x/tools@v0.8.0/go/packages/packages.go:839 +0x48 golang.org/x/tools/go/packages.(loader).loadRecursive.func1.1(0x0?) /Users/bruce/go/pkg/mod/golang.org/x/tools@v0.8.0/go/packages/packages.go:846 +0x30 created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 24 /Users/bruce/go/pkg/mod/golang.org/x/tools@v0.8.0/go/packages/packages.go:845 +0x84 bruce@kkk-bruce connectionquality % bruce@kkk-bruce connectionquality % bruce@kkk-bruce connectionquality % bruce@kkk-bruce connectionquality % bruce@kkk-bruce connectionquality % go-callvis scorer.go panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x103147404]

goroutine 526 [running]: go/types.(Checker).handleBailout(0x140008e5500, 0x14000b0bbb8) /usr/local/go/src/go/types/check.go:404 +0x9c panic({0x1036a9a80?, 0x103af3ad0?}) /usr/local/go/src/runtime/panic.go:785 +0x124 go/types.(StdSizes).Sizeof(0x0, {0x10374c598, 0x103afaa00}) /usr/local/go/src/go/types/sizes.go:229 +0x314 go/types.(Config).sizeof(...) /usr/local/go/src/go/types/sizes.go:334 go/types.representableConst.func1({0x10374c598?, 0x103afaa00?}) /usr/local/go/src/go/types/const.go:77 +0x90 go/types.representableConst({0x10374ff98, 0x103aab388}, 0x140008e5500, 0x103afaa00, 0x14000b0b488) /usr/local/go/src/go/types/const.go:93 +0x134 go/types.(Checker).representation(0x140008e5500, 0x14000242400, 0x103afaa00) /usr/local/go/src/go/types/const.go:257 +0x68 go/types.(Checker).implicitTypeAndValue(0x140008e5500, 0x14000242400, {0x10374c5e8, 0x14000b120e0}) /usr/local/go/src/go/types/expr.go:377 +0x304 go/types.(Checker).assignment(0x140008e5500, 0x14000242400, {0x10374c5e8, 0x14000b120e0}, {0x103534b13, 0x14}) /usr/local/go/src/go/types/assignments.go:70 +0x3ac go/types.(Checker).initConst(0x140008e5500, 0x140001cf1a0, 0x14000242400) /usr/local/go/src/go/types/assignments.go:144 +0x1f8 go/types.(Checker).constDecl(0x140008e5500, 0x140001cf1a0, {0x10374ea10, 0x140008fa0e0}, {0x10374e950, 0x140008f4090}, 0x0) /usr/local/go/src/go/types/decl.go:482 +0x23c go/types.(Checker).objDecl(0x140008e5500, {0x1037574d8, 0x140001cf1a0}, 0x0) /usr/local/go/src/go/types/decl.go:185 +0x840 go/types.(Checker).packageObjects(0x140008e5500) /usr/local/go/src/go/types/resolver.go:714 +0x3f0 go/types.(Checker).checkFiles(0x140008e5500, {0x140008f6000, 0x1, 0x1}) /usr/local/go/src/go/types/check.go:459 +0x190 go/types.(Checker).Files(0x140001cc0e0?, {0x140008f6000?, 0x140001cee40?, 0x6?}) /usr/local/go/src/go/types/check.go:422 +0x80 golang.org/x/tools/go/packages.(loader).loadPackage(0x140001cc0e0, 0x14000231110) /Users/bruce/go/pkg/mod/golang.org/x/tools@v0.8.0/go/packages/packages.go:1052 +0x858 golang.org/x/tools/go/packages.(loader).loadRecursive.func1() /Users/bruce/go/pkg/mod/golang.org/x/tools@v0.8.0/go/packages/packages.go:851 +0x178 sync.(Once).doSlow(0x0?, 0x0?) /usr/local/go/src/sync/once.go:76 +0xf8 sync.(Once).Do(...) /usr/local/go/src/sync/once.go:67 golang.org/x/tools/go/packages.(loader).loadRecursive(0x0?, 0x0?) /Users/bruce/go/pkg/mod/golang.org/x/tools@v0.8.0/go/packages/packages.go:839 +0x48 golang.org/x/tools/go/packages.(loader).loadRecursive.func1.1(0x0?) /Users/bruce/go/pkg/mod/golang.org/x/tools@v0.8.0/go/packages/packages.go:846 +0x30 created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 164 /Users/bruce/go/pkg/mod/golang.org/x/tools@v0.8.0/go/packages/packages.go:845 +0x84

mutantkeyboard commented 1 week ago

I'm having the exact same issue.