Skip to content

Crash with gotip and latest tagged version (but not master) #851

Closed
@justinsb

Description

@justinsb

The latest tagged version is v0.13.0, which includes golang.org/x/tools@ v0.12.0. Versions of golang.org/x/tools before v0.13.0 panic on the development go version (e.g. gotip) when generating CRDs.

master has golang.org/x/tools v0.14.0, which does not panic.

Can we please tag a new version which includes golang.org/x/tools v0.14.0 (technically v0.13.0 would avoid the panic also). I'm happy to do that / propose a PR as desired.

To reproduce:

After installing gotip (go install golang.org/dl/gotip@latest; gotip download)

git co v0.13.0
go test -test.count=1 ./pkg/crd # Passes with go 1.21.3
gotip test -test.count=1 ./pkg/crd # Panics

The panic looks like this (though it is fixed, so I assume known):

Running Suite: CRD Generation Suite
===================================
Random Seed: 1698232074
Will run 32 of 32 specs

••••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=0x9fa14f]

goroutine 149 [running]:
go/types.(*Checker).handleBailout(0xc0007f4960, 0xc000765d08)
        /home/justinsb/sdk/gotip/src/go/types/check.go:332 +0x88
panic({0xbfd460?, 0x138f180?})
        /home/justinsb/sdk/gotip/src/runtime/panic.go:763 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xe01d38, 0x13992e0})
        /home/justinsb/sdk/gotip/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
        /home/justinsb/sdk/gotip/src/go/types/sizes.go:333
go/types.representableConst.func1({0xe01d38?, 0x13992e0?})
        /home/justinsb/sdk/gotip/src/go/types/const.go:76 +0x9e
go/types.representableConst({0xe08290, 0x12e0888}, 0xc0007f4960, 0x13992e0, 0xc000765480)
        /home/justinsb/sdk/gotip/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0007f4960, 0xc000d789c0, 0x13992e0)
        /home/justinsb/sdk/gotip/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0007f4960, 0xc000d789c0, {0xe01d60, 0xc0003ac230})
        /home/justinsb/sdk/gotip/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).assignment(0xc0007f4960, 0xc000d789c0, {0xe01d60, 0xc0003ac230}, {0xcd68ff, 0x14})
        /home/justinsb/sdk/gotip/src/go/types/assignments.go:52 +0x417
go/types.(*Checker).initConst(0xc0007f4960, 0xc000699080, 0xc000d789c0)
        /home/justinsb/sdk/gotip/src/go/types/assignments.go:126 +0x329
go/types.(*Checker).constDecl(0xc0007f4960, 0xc000699080, {0xe04ed0, 0xc0006e1240}, {0xe06070, 0xc0006aade0}, 0x0)
        /home/justinsb/sdk/gotip/src/go/types/decl.go:482 +0x353
go/types.(*Checker).objDecl(0xc0007f4960, {0xe0d698, 0xc000699080}, 0x0)
        /home/justinsb/sdk/gotip/src/go/types/decl.go:191 +0xa49
go/types.(*Checker).packageObjects(0xc0007f4960)
        /home/justinsb/sdk/gotip/src/go/types/resolver.go:687 +0x454
go/types.(*Checker).checkFiles(0xc0007f4960, {0xc000682000?, 0x1, 0x1})
        /home/justinsb/sdk/gotip/src/go/types/check.go:380 +0x225
go/types.(*Checker).Files(...)
        /home/justinsb/sdk/gotip/src/go/types/check.go:337
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc000206720, 0xc00021bd80)
        /home/justinsb/k8s/src/sigs.k8s.io/controller-tools/pkg/loader/loader.go:286 +0x49e
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc00021bd80)
        /home/justinsb/k8s/src/sigs.k8s.io/controller-tools/pkg/loader/loader.go:99 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc000630570, 0xc00021bd80)
        /home/justinsb/k8s/src/sigs.k8s.io/controller-tools/pkg/loader/refs.go:268 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x0?)
        /home/justinsb/k8s/src/sigs.k8s.io/controller-tools/pkg/loader/refs.go:262 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 104
        /home/justinsb/k8s/src/sigs.k8s.io/controller-tools/pkg/loader/refs.go:260 +0x1c5
FAIL    sigs.k8s.io/controller-tools/pkg/crd    0.309s
FAIL

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions