Skip to content

Instantly share code, notes, and snippets.

@nenodias
Created April 11, 2024 13:59
Show Gist options
  • Save nenodias/5d1865de385633f213a3ad1cf31947bc to your computer and use it in GitHub Desktop.
Save nenodias/5d1865de385633f213a3ad1cf31947bc to your computer and use it in GitHub Desktop.
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=0x1 addr=0x0 pc=0x615c5e]
goroutine 38 [running]:
go/types.(*Checker).handleBailout(0xc00043c000, 0xc0002cdbd0)
/usr/local/go/src/go/types/check.go:367 +0x88
panic({0xa9d000?, 0xfa2cb0?})
/usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xc17ab8, 0xfa99a0})
/usr/local/go/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
/usr/local/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0xc17ab8?, 0xfa99a0?})
/usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0xc1ad88, 0xff8c20}, 0xc00043c000, 0xfa99a0, 0xc0002cbfe8)
/usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc00043c000, 0xc00043afc0, 0xfa99a0)
/usr/local/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc00043c000, 0xc00043afc0, {0xc17ab8, 0xfa99a0})
/usr/local/go/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).convertUntyped(0xc00043c000, 0xc00043afc0, {0xc17ab8, 0xfa99a0})
/usr/local/go/src/go/types/const.go:289 +0x3f
go/types.(*Checker).matchTypes(0xc00043c000, 0xc00043af80, 0xc00043afc0)
/usr/local/go/src/go/types/expr.go:926 +0x79
go/types.(*Checker).binary(0xc00043c000, 0xc00043af80, {0xc19670, 0xc0004e84b0}, {0xc19700, 0xc0004961e0}, {0xc19c40, 0xc000496200}, 0x28, 0x704c)
/usr/local/go/src/go/types/expr.go:800 +0x166
go/types.(*Checker).exprInternal(0xc00043c000, 0x0, 0xc00043af80, {0xc19670, 0xc0004e84b0}, {0x0, 0x0})
/usr/local/go/src/go/types/expr.go:1416 +0x206
go/types.(*Checker).rawExpr(0xc00043c000, 0x0, 0xc00043af80, {0xc19670?, 0xc0004e84b0?}, {0x0?, 0x0?}, 0x0)
/usr/local/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc00043c000, 0xc17e50?, 0xc00043af80, {0xc19670?, 0xc0004e84b0?})
/usr/local/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).stmt(0xc00043c000, 0x0, {0xc19a60, 0xc00043a140})
/usr/local/go/src/go/types/stmt.go:570 +0x11f2
go/types.(*Checker).stmtList(0xc00043c000, 0x0, {0xc000496380?, 0x0?, 0x0?})
/usr/local/go/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc00043c000, 0xc17ab8?, {0xc000280150?, 0xfa9b80?}, 0xc00043acc0, 0xc0004e8540, {0x0?, 0x0?})
/usr/local/go/src/go/types/stmt.go:41 +0x331
go/types.(*Checker).funcDecl.func1()
/usr/local/go/src/go/types/decl.go:852 +0x3a
go/types.(*Checker).processDelayed(0xc00043c000, 0x0)
/usr/local/go/src/go/types/check.go:467 +0x162
go/types.(*Checker).checkFiles(0xc00043c000, {0xc0002b4020, 0x1, 0x1})
/usr/local/go/src/go/types/check.go:411 +0x1cc
go/types.(*Checker).Files(...)
/usr/local/go/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc0001b6000, 0xc00058a450)
/home/username/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:1052 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
/home/username/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:851 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
/usr/local/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
/usr/local/go/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
/home/username/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:839 +0x4a
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
/home/username/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:846 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 24
/home/username/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:845 +0x94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment