derision-test / go-mockgen

MIT License
57 stars 7 forks source link

Panic with Go 1.22.0 #51

Closed unknwon closed 4 months ago

unknwon commented 4 months ago
go-mockgen: loading data for 3 packages
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=0x102e871e0]

goroutine 190 [running]:
go/types.(*Checker).handleBailout(0x14000570000, 0x140005efc38)
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/check.go:367 +0x9c
panic({0x102ffb480?, 0x103295480?})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/runtime/panic.go:770 +0x124
go/types.(*StdSizes).Sizeof(0x0, {0x10305a4d8, 0x103299520})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/sizes.go:228 +0x320
go/types.(*Config).sizeof(...)
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/sizes.go:333
go/types.representableConst.func1({0x10305a4d8?, 0x103299520?})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/const.go:76 +0x9c
go/types.representableConst({0x10305c3b8, 0x10328c9e0}, 0x14000570000, 0x103299520, 0x140005ee838)
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/const.go:92 +0x138
go/types.(*Checker).representation(0x14000570000, 0x140003d8a00, 0x103299520)
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/const.go:256 +0x68
go/types.(*Checker).implicitTypeAndValue(0x14000570000, 0x140003d8a00, {0x10305a4d8, 0x103299520})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/expr.go:375 +0x340
go/types.(*Checker).assignment(0x14000570000, 0x140003d8a00, {0x10305a4d8, 0x103299520}, {0x102f272fb, 0x10})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/assignments.go:52 +0x23c
go/types.(*Checker).initVar(0x14000570000, 0x140006262a0, 0x140003d8a00, {0x102f272fb, 0x10})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/assignments.go:163 +0x39c
go/types.(*Checker).initVars(0x14000570000, {0x14000932180, 0x1, 0x102e978ac?}, {0x14000924130, 0x102e977f0?, 0x1?}, {0x10305bc40, 0x1400017c600?})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/assignments.go:382 +0x588
go/types.(*Checker).stmt(0x14000570000, 0x0, {0x10305bc40, 0x1400017c600})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/stmt.go:524 +0x18a4
go/types.(*Checker).stmtList(0x14000570000, 0x0, {0x14000924140?, 0x0?, 0x0?})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/stmt.go:121 +0x88
go/types.(*Checker).funcBody(0x14000570000, 0x10305a4d8?, {0x140008803f4?, 0x103299520?}, 0x140003d8980, 0x1400019d740, {0x0?, 0x0?})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/stmt.go:41 +0x21c
go/types.(*Checker).funcDecl.func1()
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/decl.go:852 +0x44
go/types.(*Checker).processDelayed(0x14000570000, 0x0)
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/check.go:467 +0x12c
go/types.(*Checker).checkFiles(0x14000570000, {0x14000020050, 0x2, 0x2})
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/check.go:411 +0x188
go/types.(*Checker).Files(...)
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0x14000246000, 0x1400021ee00)
    /Users/unknwon/go/pkg/mod/golang.org/x/tools@v0.1.10/go/packages/packages.go:966 +0x624
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
    /Users/unknwon/go/pkg/mod/golang.org/x/tools@v0.1.10/go/packages/packages.go:803 +0x178
sync.(*Once).doSlow(0x0?, 0x0?)
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/sync/once.go:74 +0x100
sync.(*Once).Do(...)
    /opt/homebrew/Cellar/go/1.22.0/libexec/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
    /Users/unknwon/go/pkg/mod/golang.org/x/tools@v0.1.10/go/packages/packages.go:791 +0x50
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
    /Users/unknwon/go/pkg/mod/golang.org/x/tools@v0.1.10/go/packages/packages.go:798 +0x30
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 186
    /Users/unknwon/go/pkg/mod/golang.org/x/tools@v0.1.10/go/packages/packages.go:797 +0x84
exit status 2

🤔