Skip to content

k8s UT typecheck/TestVerify: crashes when built with Go at tip due to go/types.Sizes change  #62247

Not planned
@Rajalakshmi-Girish

Description

@Rajalakshmi-Girish

What version of Go are you using (go version)?

$ go version
go tip

This started crashing after 5fa4aac

Does this issue reproduce with the latest release?

No

What operating system and processor architecture are you using (go env)?

"CentOS Stream 8", x86_64

go env Output
$ go env

What did you do?

  1. Install go tip version
  2. git clone https://github.com/kubernetes/kubernetes
  3. cd kubernetes/test/typecheck/
  4. go test -v -race -run ^TestVerify

What did you expect to see?

The test must PASS

What did you see instead?

[root@maxwells1 typecheck]# go test -v -race -run ^TestVerify
=== RUN   TestVerify
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=0x71396d]

goroutine 51 [running]:
go/types.(*Checker).handleBailout(0xc0003e2000, 0xc00011d9a8)
        /usr/local/go/src/go/types/check.go:339 +0xdb
panic({0x7cd7a0?, 0xa3b980?})
        /usr/local/go/src/runtime/panic.go:765 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x89b850?, 0xa3c9e0})
        /usr/local/go/src/go/types/sizes.go:228 +0x54d
go/types.(*Config).sizeof(...)
        /usr/local/go/src/go/types/sizes.go:331
go/types.representableConst.func1({0x89b850, 0xa3c9e0})
        /usr/local/go/src/go/types/const.go:76 +0x110
go/types.representableConst({0x89cd88, 0xa2cfa0}, 0xc0003e2000, 0xa3c9e0, 0xc00011bd50)
        /usr/local/go/src/go/types/const.go:92 +0x1cd
go/types.(*Checker).representation(0x89b850?, 0xc0003e64c0, 0x4?)
        /usr/local/go/src/go/types/const.go:256 +0xad
go/types.(*Checker).implicitTypeAndValue(0xc0003e2000, 0xc0003e64c0, {0x89b850?, 0xa3c9e0?})
        /usr/local/go/src/go/types/expr.go:375 +0x26a
go/types.(*Checker).assignment(0xc0003e2000, 0xc0003e64c0, {0x89b850, 0xa3c9e0}, {0x8140fa, 0x10})
        /usr/local/go/src/go/types/assignments.go:52 +0x6d6
go/types.(*Checker).initVar(0x4a8a51?, 0xc0003a7da0, 0xc0003e64c0, {0x8140fa, 0x10})
        /usr/local/go/src/go/types/assignments.go:163 +0x6ee
go/types.(*Checker).initVars(0x4a7299?, {0xc0002c22c8?, 0x1, 0x1}, {0xc000297d90?, 0x1, 0x1}, {0x89c318, 0xc0003870a0})
        /usr/local/go/src/go/types/assignments.go:372 +0x9c9
go/types.(*Checker).stmt(0xc0003e2000, 0x0, {0x89c318?, 0xc0003870a0?})
        /usr/local/go/src/go/types/stmt.go:527 +0x1fd9
go/types.(*Checker).stmtList(0xc0003ba810?, 0x0, {0xc000297da0, 0x1, 0x0?})
        /usr/local/go/src/go/types/stmt.go:124 +0xd2
go/types.(*Checker).funcBody(0xc0003e2000, 0xc0003a7260, {0xc0003e003a, 0x6}, 0xc0003e6440, 0xc0003ba810, {0x0, 0x0})
        /usr/local/go/src/go/types/stmt.go:44 +0x539
go/types.(*Checker).funcDecl.func1()
        /usr/local/go/src/go/types/decl.go:826 +0xb6
go/types.(*Checker).processDelayed(0xc0003e2000, 0x0)
        /usr/local/go/src/go/types/check.go:446 +0x302
go/types.(*Checker).checkFiles(0xc0003e2000, {0xc000297c10, 0x2, 0x2})
        /usr/local/go/src/go/types/check.go:390 +0x3dd
go/types.(*Checker).Files(...)
        /usr/local/go/src/go/types/check.go:344
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc0001041c0, 0xc0002891d0)
        /root/kubernetes/vendor/golang.org/x/tools/go/packages/packages.go:1052 +0x1b3a
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        /root/kubernetes/vendor/golang.org/x/tools/go/packages/packages.go:851 +0x354
sync.(*Once).doSlow(0xc0002891e0, 0xc000194f58)
        /usr/local/go/src/sync/once.go:74 +0xd8
sync.(*Once).Do(0xc0002891e0, 0x0?)
        /usr/local/go/src/sync/once.go:65 +0x45
golang.org/x/tools/go/packages.(*loader).loadRecursive(0xc0001041c0, 0xc0002891d0)
        /root/kubernetes/vendor/golang.org/x/tools/go/packages/packages.go:839 +0x67
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
        /root/kubernetes/vendor/golang.org/x/tools/go/packages/packages.go:846 +0x3e
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 47
        /root/kubernetes/vendor/golang.org/x/tools/go/packages/packages.go:845 +0xf0
exit status 2
FAIL    k8s.io/kubernetes/test/typecheck        0.632s
[root@maxwells1 typecheck]#

Activity

Rajalakshmi-Girish

Rajalakshmi-Girish commented on Aug 23, 2023

@Rajalakshmi-Girish
Author

Saw another runtime error due to same change #62191

seankhliao

seankhliao commented on Aug 23, 2023

@seankhliao
Member

go tip right now requires a tip version of x/tools.

Rajalakshmi-Girish

Rajalakshmi-Girish commented on Aug 24, 2023

@Rajalakshmi-Girish
Author

go tip right now requires a tip version of x/tools.

Does that mean, next release of x/tools will avoid the panic that we see now?

Rajalakshmi-Girish

Rajalakshmi-Girish commented on Aug 24, 2023

@Rajalakshmi-Girish
Author

go tip right now requires a tip version of x/tools.

Does that mean, next release of x/tools will avoid the panic that we see now?

@seankhliao Can you please clarify?

locked and limited conversation to collaborators on Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @gopherbot@seankhliao@Rajalakshmi-Girish

        Issue actions

          k8s UT typecheck/TestVerify: crashes when built with Go at tip due to go/types.Sizes change · Issue #62247 · golang/go