go-tools icon indicating copy to clipboard operation
go-tools copied to clipboard

panic: no ir.Value for var actual interface{}

Open uhthomas opened this issue 2 years ago • 4 comments

I'm seeing strange race conditions where sometimes ir.Values are missing. Works okay when rerun.

(16:39:55) ERROR: /home/thomas/.cache/bazel/_bazel_thomas/b3860946b0ed29b82afe181b73c30609/external/com_github_stretchr_testify/require/BUILD.bazel:3:11: GoCompilePkg external/com_github_stretchr_testify/require/require.a failed: (Exit 1): builder failed: error executing command bazel-out/host/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_stretchr_testify/require/doc.go -src ... (remaining 25 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
compilepkg: panic: no ir.Value for var actual interface{}

goroutine 190 [running]:
honnef.co/go/tools/go/ir.(*Function).lookup(0xc000ff1560, {0xbe8dc0, 0xc0008b8b40}, 0x0)
        external/co_honnef_go_tools/go/ir/func.go:726 +0x345
honnef.co/go/tools/go/ir.(*builder).addr(0xa887a0?, 0xc000ff1560, {0xbe27a8?, 0xc0001bdcc0}, 0x0)
        external/co_honnef_go_tools/go/ir/builder.go:313 +0x196
honnef.co/go/tools/go/ir.(*builder).expr(0xabe1a0?, 0xc000ff1560, {0xbe27a8?, 0xc0001bdcc0?})
        external/co_honnef_go_tools/go/ir/builder.go:510 +0x148
honnef.co/go/tools/go/ir.(*builder).emitCallArgs(0xc0006c4b40?, 0xc000ff1560, 0xc000839940, 0xc000bcad38?, {0x0?, 0xc0005dae68?, 0x57d287?})
        external/co_honnef_go_tools/go/ir/builder.go:864 +0xd65
honnef.co/go/tools/go/ir.(*builder).setCall(0xa86e20?, 0xc000ff1560, 0xc000418700, 0xc000bcad38)
        external/co_honnef_go_tools/go/ir/builder.go:940 +0x94
honnef.co/go/tools/go/ir.(*builder).expr0(0xc0005dba30, 0xc000ff1560, {0xbe24a8?, 0xc000418700}, {0x1, {0xbe1140, 0x0}, {0x0, 0x0}})
        external/co_honnef_go_tools/go/ir/builder.go:569 +0x2326
honnef.co/go/tools/go/ir.(*builder).expr(0xc000ff1560?, 0xc000ff1560, {0xbe24a8?, 0xc000418700?})
        external/co_honnef_go_tools/go/ir/builder.go:512 +0x1d8
honnef.co/go/tools/go/ir.(*builder).stmt(0xae1c00?, 0xc000ff1560, {0xbe2658?, 0xc000283600?})
        external/co_honnef_go_tools/go/ir/builder.go:2134 +0xd5b
honnef.co/go/tools/go/ir.(*builder).stmtList(0x40?, 0xace3a0?, {0xc0001bdd40?, 0x2, 0x89b445?})
        external/co_honnef_go_tools/go/ir/builder.go:764 +0x67
honnef.co/go/tools/go/ir.(*builder).stmt(0xc000ff1560?, 0xc000ff1560, {0xbe2448?, 0xc0001ccbd0?})
        external/co_honnef_go_tools/go/ir/builder.go:2241 +0xd31
honnef.co/go/tools/go/ir.(*builder).buildFunction(0xc0005dba30, 0xc000ff1560)
        external/co_honnef_go_tools/go/ir/builder.go:2353 +0x44a
honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0xc001b9e540?, 0xc0006c4b40, 0xc0001ccc00)
        external/co_honnef_go_tools/go/ir/builder.go:2391 +0x195
honnef.co/go/tools/go/ir.(*Package).build(0xc0006c4b40)
        external/co_honnef_go_tools/go/ir/builder.go:2497 +0xc52
sync.(*Once).doSlow(0xc0004882a0?, 0xc0003cdcc0?)
        GOROOT/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
        GOROOT/src/sync/once.go:59
honnef.co/go/tools/go/ir.(*Package).Build(...)
        external/co_honnef_go_tools/go/ir/builder.go:2415
honnef.co/go/tools/internal/passes/buildir.run(0xc000151e10)
        external/co_honnef_go_tools/internal/passes/buildir/buildir.go:86 +0x368
main.(*action).execOnce(0xc0002259e0)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:286 +0x817
sync.(*Once).doSlow(0x0?, 0x0?)
        GOROOT/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
        GOROOT/src/sync/once.go:59
main.(*action).exec(0x0?)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:230 +0x3d
main.execAll.func1(0x0?)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:224 +0x54
created by main.execAll
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:222 +0x47
(01:16:03) ERROR: /home/thomas/.cache/bazel/_bazel_thomas/b3860946b0ed29b82afe181b73c30609/external/com_github_stretchr_testify/assert/BUILD.bazel:3:11: GoCompilePkg external/com_github_stretchr_testify/assert/assert.a failed: (Exit 1): builder failed: error executing command bazel-out/host/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_stretchr_testify/assert/assertion_compare.go -src ... (remaining 37 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
compilepkg: panic: no ir.Value for var object interface{}

goroutine 290 [running]:
honnef.co/go/tools/go/ir.(*Function).lookup(0xc0018f67e0, {0xbeb340, 0xc0009ddb80}, 0x0)
        external/co_honnef_go_tools/go/ir/func.go:726 +0x345
honnef.co/go/tools/go/ir.(*builder).addr(0xa8a800?, 0xc0018f67e0, {0xbe4d28?, 0xc0003552e0}, 0x0)
        external/co_honnef_go_tools/go/ir/builder.go:313 +0x196
honnef.co/go/tools/go/ir.(*builder).expr(0xac0200?, 0xc0018f67e0, {0xbe4d28?, 0xc0003552e0?})
        external/co_honnef_go_tools/go/ir/builder.go:510 +0x148
honnef.co/go/tools/go/ir.(*builder).emitCallArgs(0xc00044bd40?, 0xc0018f67e0, 0xc000976780, 0xc0021d5ea8?, {0x0?, 0xc001062e68?, 0x57d287?})
        external/co_honnef_go_tools/go/ir/builder.go:864 +0xd65
honnef.co/go/tools/go/ir.(*builder).setCall(0xa88e80?, 0xc0018f67e0, 0xc000351280, 0xc0021d5ea8)
        external/co_honnef_go_tools/go/ir/builder.go:940 +0x94
honnef.co/go/tools/go/ir.(*builder).expr0(0xc001063a30, 0xc0018f67e0, {0xbe4a28?, 0xc000351280}, {0x7, {0xbe3530, 0xf32640}, {0x0, 0x0}})
        external/co_honnef_go_tools/go/ir/builder.go:569 +0x2326
honnef.co/go/tools/go/ir.(*builder).expr(0xc0018f67e0?, 0xc0018f67e0, {0xbe4a28?, 0xc000351280?})
        external/co_honnef_go_tools/go/ir/builder.go:512 +0x1d8
honnef.co/go/tools/go/ir.(*builder).stmt(0xae3c60?, 0xc0018f67e0, {0xbe4f68?, 0xc000355340?})
        external/co_honnef_go_tools/go/ir/builder.go:2194 +0x1ad8
honnef.co/go/tools/go/ir.(*builder).stmtList(0x203000?, 0x4?, {0xc000355360?, 0x2, 0x89b445?})
        external/co_honnef_go_tools/go/ir/builder.go:764 +0x67
honnef.co/go/tools/go/ir.(*builder).stmt(0xc0018f67e0?, 0xc0018f67e0, {0xbe49c8?, 0xc000352930?})
        external/co_honnef_go_tools/go/ir/builder.go:2241 +0xd31
honnef.co/go/tools/go/ir.(*builder).buildFunction(0xc001063a30, 0xc0018f67e0)
        external/co_honnef_go_tools/go/ir/builder.go:2353 +0x44a
honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0x0?, 0xc00044bd40, 0xc000352960)
        external/co_honnef_go_tools/go/ir/builder.go:2391 +0x195
honnef.co/go/tools/go/ir.(*Package).build(0xc00044bd40)
        external/co_honnef_go_tools/go/ir/builder.go:2497 +0xc52
sync.(*Once).doSlow(0xc0003a4380?, 0xc000288c80?)
        GOROOT/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
        GOROOT/src/sync/once.go:59
honnef.co/go/tools/go/ir.(*Package).Build(...)
        external/co_honnef_go_tools/go/ir/builder.go:2415
honnef.co/go/tools/internal/passes/buildir.run(0xc00128e000)
        external/co_honnef_go_tools/internal/passes/buildir/buildir.go:86 +0x368
main.(*action).execOnce(0xc0000e3950)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:286 +0x817
sync.(*Once).doSlow(0x0?, 0x0?)
        GOROOT/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
        GOROOT/src/sync/once.go:59
main.(*action).exec(0x0?)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:230 +0x3d
main.execAll.func1(0x0?)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:224 +0x54
created by main.execAll
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:222 +0x47

uhthomas avatar Mar 19 '22 05:03 uhthomas

Please fill out the issue template and provide instructions on how I can reproduce the issue, namely where the code is and what commands you used.

dominikh avatar Mar 19 '22 17:03 dominikh

Hi @dominikh. I'm working to find a way to reproduce this, but so far have not. This is an issue as we see it happen transiently, but have no idea why. Today is compilepkg: panic: no ir.Value for var delta float64. A clean rerun was fine.

Nothing immediately obvious around the offending message either?

https://github.com/dominikh/go-tools/blob/c8d2d1b07f1874f4f3e1478056e3fa107e4b03eb/go/ir/func.go#L728

uhthomas avatar Apr 05 '22 14:04 uhthomas

Are you sure that whatever bazel magic you use for running Staticcheck analyzes isn't broken?

dominikh avatar Apr 05 '22 14:04 dominikh

Just logging this here.

I'll try to take a closer look and make a reproducer at some point. It's quite tricky to find the problem :/

(16:53:50) ERROR: /private/var/tmp/_bazel_thomas/796dd52d4d981101108548a9446ddca6/external/com_github_golang_protobuf/proto/BUILD.bazel:3:11: GoCompilePkg external/com_github_golang_protobuf/proto/proto.a failed: (Exit 1): builder failed: error executing command bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix darwin_arm64 -src external/com_github_golang_protobuf/proto/buffer.go -src ... (remaining 53 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
compilepkg: panic: internal error: unhandled type *ir.Convert

goroutine 103 [running]:
honnef.co/go/tools/analysis/facts/typedness.impl.func3({0x104bb3850?, 0x14001befec0?}, 0x1051261d8?)
        external/co_honnef_go_tools/analysis/facts/typedness/typedness.go:229 +0x77c
honnef.co/go/tools/analysis/facts/typedness.impl.func3({0x104bb4008?, 0x14001c16af0?}, 0x14000bfcb40?)
        external/co_honnef_go_tools/analysis/facts/typedness/typedness.go:208 +0x874
honnef.co/go/tools/analysis/facts/typedness.impl(0x14001a0c270, 0x14000bfcb40, 0x140004f7c98)
        external/co_honnef_go_tools/analysis/facts/typedness/typedness.go:236 +0x4a0
honnef.co/go/tools/analysis/facts/typedness.run(0x14001a0c270)
        external/co_honnef_go_tools/analysis/facts/typedness/typedness.go:59 +0xf0
main.(*action).execOnce(0x140001ef290)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:288 +0x764
sync.(*Once).doSlow(0x0?, 0x0?)
        GOROOT/src/sync/once.go:68 +0x10c
sync.(*Once).Do(...)
        GOROOT/src/sync/once.go:59
main.(*action).exec(0x0?)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:232 +0x44
main.execAll.func1(0x0?)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:226 +0x50
created by main.execAll
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:224 +0x48

uhthomas avatar Apr 21 '22 15:04 uhthomas

Timed out, closing.

dominikh avatar Nov 17 '23 17:11 dominikh