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

Random panics #16

Open
shackra opened this issue Mar 7, 2024 · 1 comment
Open

Random panics #16

shackra opened this issue Mar 7, 2024 · 1 comment

Comments

@shackra
Copy link
Contributor

shackra commented Mar 7, 2024

I was generating mocks for some modules in my project, and I noticed that mockigo panics when there are already files named with _test.go (or so I believe this has to do with the panics)

➜  mockigo --test-pkg --gogen
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=0x587eef]

goroutine 24 [running]:
go/types.(*Checker).handleBailout(0xc0004db200, 0xc000c75bd0)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/check.go:367 +0x88
panic({0x63b4e0?, 0x82c430?})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x6d4fe8, 0x82f360})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0x6d4fe8?, 0x82f360?})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x6d6878, 0x825128}, 0xc0004db200, 0x82f360, 0xc000c73fe8)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0004db200, 0xc000c5ba40, 0x82f360)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0004db200, 0xc000c5ba40, {0x6d4fe8, 0x82f360})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/expr.go:375 +0x2d7
go/types.(*Checker).convertUntyped(0xc0004db200, 0xc000c5ba40, {0x6d4fe8, 0x82f360})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/const.go:289 +0x3f
go/types.(*Checker).matchTypes(0xc0004db200, 0xc000c5ba00, 0xc000c5ba40)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/expr.go:926 +0x79
go/types.(*Checker).binary(0xc0004db200, 0xc000c5ba00, {0x6d5ae0, 0xc000b06360}, {0x6d5bd0, 0xc000b2e0c0}, {0x6d5bd0, 0xc000b2e0d8}, 0x2c, 0x15607b6)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/expr.go:800 +0x166
go/types.(*Checker).exprInternal(0xc0004db200, 0x0, 0xc000c5ba00, {0x6d5ae0, 0xc000b06360}, {0x0, 0x0})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/expr.go:1416 +0x206
go/types.(*Checker).rawExpr(0xc0004db200, 0x0, 0xc000c5ba00, {0x6d5ae0?, 0xc000b06360?}, {0x0?, 0x0?}, 0x0)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc0004db200, 0x6d5240?, 0xc000c5ba00, {0x6d5ae0?, 0xc000b06360?})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).stmt(0xc0004db200, 0x0, {0x6d5ed0, 0xc000b2c840})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/stmt.go:570 +0x11f2
go/types.(*Checker).stmtList(0xc0004db200, 0x0, {0xc000b2c880?, 0x0?, 0x28?})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc0004db200, 0x6d4e30?, {0xc000300940?, 0xc0000e6070?}, 0xc000c5aa80, 0xc000b063f0, {0x0?, 0x0?})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/stmt.go:41 +0x331
go/types.(*Checker).funcDecl.func1()
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/decl.go:852 +0x3a
go/types.(*Checker).processDelayed(0xc0004db200, 0x0)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/check.go:467 +0x162
go/types.(*Checker).checkFiles(0xc0004db200, {0xc000458f70, 0x2, 0x2})
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/check.go:411 +0x1cc
go/types.(*Checker).Files(...)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc000196000, 0xc000714630)
        /home/jorge/go/pkg/mod/golang.org/x/tools@v0.10.0/go/packages/packages.go:1055 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        /home/jorge/go/pkg/mod/golang.org/x/tools@v0.10.0/go/packages/packages.go:854 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
        /nix/store/jw9qrkqlkm699ncbrbs1d4czfg4wg8da-go-1.22.1/share/go/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
        /home/jorge/go/pkg/mod/golang.org/x/tools@v0.10.0/go/packages/packages.go:842 +0x4a
golang.org/x/tools/go/packages.(*loader).refine.func2(0x0?)
        /home/jorge/go/pkg/mod/golang.org/x/tools@v0.10.0/go/packages/packages.go:777 +0x26
created by golang.org/x/tools/go/packages.(*loader).refine in goroutine 1
        /home/jorge/go/pkg/mod/golang.org/x/tools@v0.10.0/go/packages/packages.go:776 +0xccf
@shackra
Copy link
Contributor Author

shackra commented Mar 7, 2024

maybe is something in Go 1.22 causing this problem?

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

No branches or pull requests

1 participant