globusdigital / deep-copy

Deep copy generator
BSD 3-Clause "New" or "Revised" License
150 stars 34 forks source link

Panics inside golang:1.22-bookworm #40

Closed slobodyanyuk closed 6 months ago

slobodyanyuk commented 7 months ago

Started to panic inside golang:1.22-bookworm docker image.

uname -a
Linux 3de55cc04cca 6.6.16-linuxkit #1 SMP Fri Feb 16 11:54:02 UTC 2024 x86_64 GNU/Linux

Trace:

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=0x59f88f]

goroutine 14 [running]:
go/types.(*Checker).handleBailout(0xc000450600, 0xc00029dc68)
    /usr/local/go/src/go/types/check.go:367 +0x88
panic({0x64cc00?, 0x83a320?})
    /usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x6e4a88, 0x83d480})
    /usr/local/go/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
    /usr/local/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0x6e4a88?, 0x83d480?})
    /usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x6e6240, 0x832e00}, 0xc000450600, 0x83d480, 0x0)
    /usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).arrayLength(0xc000450600, {0x6e5b90, 0xc0004821c0?})
    /usr/local/go/src/go/types/typexpr.go:510 +0x2d3
go/types.(*Checker).typInternal(0xc000450600, {0x6e5ce0, 0xc00008e060}, 0x0)
    /usr/local/go/src/go/types/typexpr.go:299 +0x49d
go/types.(*Checker).definedType(0xc000450600, {0x6e5ce0, 0xc00008e060}, 0xc000305250?)
    /usr/local/go/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).varType(0xc000450600, {0x6e5ce0, 0xc00008e060})
    /usr/local/go/src/go/types/typexpr.go:145 +0x25
go/types.(*Checker).structType(0xc000450600, 0xc000595710, 0xc000595710?)
    /usr/local/go/src/go/types/struct.go:113 +0x19f
go/types.(*Checker).typInternal(0xc000450600, {0x6e5d10, 0xc0001a0318}, 0xc00026f400)
    /usr/local/go/src/go/types/typexpr.go:316 +0x1345
go/types.(*Checker).definedType(0xc000450600, {0x6e5d10, 0xc0001a0318}, 0x10?)
    /usr/local/go/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).typeDecl(0xc000450600, 0xc00026f400, 0xc0000a6040, 0x0)
    /usr/local/go/src/go/types/decl.go:615 +0x44d
go/types.(*Checker).objDecl(0xc000450600, {0x6e8338, 0xc00026f400}, 0x0)
    /usr/local/go/src/go/types/decl.go:197 +0xa7f
go/types.(*Checker).packageObjects(0xc000450600)
    /usr/local/go/src/go/types/resolver.go:681 +0x425
go/types.(*Checker).checkFiles(0xc000450600, {0xc000194000, 0x1, 0x1})
    /usr/local/go/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
    /usr/local/go/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc000160000, 0xc0000f2200)
    /go/cache/mod/golang.org/x/tools@v0.0.0-20200107050322-53017a39ae36/go/packages/packages.go:838 +0x6fe
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
    /go/cache/mod/golang.org/x/tools@v0.0.0-20200107050322-53017a39ae36/go/packages/packages.go:685 +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?)
    /go/cache/mod/golang.org/x/tools@v0.0.0-20200107050322-53017a39ae36/go/packages/packages.go:673 +0x4a
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
    /go/cache/mod/golang.org/x/tools@v0.0.0-20200107050322-53017a39ae36/go/packages/packages.go:680 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 93
    /go/cache/mod/golang.org/x/tools@v0.0.0-20200107050322-53017a39ae36/go/packages/packages.go:679 +0x94

Newly built deep-copy with updated modules works:

diff --git a/go.mod b/go.mod
index 7b031a3..bffdc8d 100644
--- a/go.mod
+++ b/go.mod
@@ -5,5 +5,6 @@ go 1.13
 require (
        github.com/google/go-cmp v0.5.5
        github.com/stretchr/testify v1.8.4
-       golang.org/x/tools v0.0.0-20200107050322-53017a39ae36
+       golang.org/x/mod v0.17.0 // indirect
+       golang.org/x/tools v0.19.0
 )

Could you please bump modules?