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

cmd/compile: ICE: unexpected types2.Invalid in writePkgStub #71454

Open
adonovan opened this issue Jan 27, 2025 · 3 comments
Open

cmd/compile: ICE: unexpected types2.Invalid in writePkgStub #71454

adonovan opened this issue Jan 27, 2025 · 3 comments
Assignees
Labels
BugReport Issues describing a possible bug in the Go implementation. compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@adonovan
Copy link
Member

Observed in https://ci.chromium.org/ui/p/golang/builders/ci/x_tools-gotip-darwin-amd64-longtest/b8725796120163106641/overview, attached to umbrella issue #70399 (comment):

=== RUN   TestVetStdlib
    vet_std_test.go:101: go vet std failed (exit status 1):
        # math/rand/v2 [math/rand/v2.test]
        <unknown line number>: internal compiler error: unexpected types2.Invalid
        
        goroutine 1 [running]:
        runtime/debug.Stack()
        	runtime/debug/stack.go:26 +0x5e
        cmd/compile/internal/base.FatalfAt({0x528d00?, 0xc0?}, {0x75726fe, 0x19}, {0x0, 0x0, 0x0})
        	cmd/compile/internal/base/print.go:230 +0x1ea
        cmd/compile/internal/base.Fatalf(...)
        	cmd/compile/internal/base/print.go:195
        cmd/compile/internal/noder.(*pkgWriter).typIdx(0xc000528d00, {0x77dfa70, 0x7d78560}, 0xc000183ea0)
        	cmd/compile/internal/noder/writer.go:533 +0x597
        cmd/compile/internal/noder.(*writer).typ(0xc0007338c0, {0x77dfa70?, 0x7d78560?})
        	cmd/compile/internal/noder/writer.go:481 +0x2f
        cmd/compile/internal/noder.(*writer).unionType(0xc0007338c0, 0xc0000106a8)
        	cmd/compile/internal/noder/writer.go:651 +0x6a
        cmd/compile/internal/noder.(*pkgWriter).typIdx(0xc000528d00, {0x77dfb88, 0xc0000106a8}, 0xc000183ea0)
        	cmd/compile/internal/noder/writer.go:609 +0x42e
        cmd/compile/internal/noder.(*writer).typ(0xc000733810, {0x77dfb88?, 0xc0000106a8?})
        	cmd/compile/internal/noder/writer.go:481 +0x2f
        cmd/compile/internal/noder.(*writer).interfaceType(0xc000733810, 0xc000513310)
        	cmd/compile/internal/noder/writer.go:696 +0x2a5
        cmd/compile/internal/noder.(*pkgWriter).typIdx(0xc000528d00, {0x77dfa20, 0xc000513310}, 0xc000183ea0)
        	cmd/compile/internal/noder/writer.go:605 +0x98a
        cmd/compile/internal/noder.(*writer).typ(0xc000733550, {0x77dfa20?, 0xc000513310?})
        	cmd/compile/internal/noder/writer.go:481 +0x2f
        cmd/compile/internal/noder.(*writer).doObj(0xc000733550, 0xc000733600, {0x77e7760, 0xc0003edbc0})
        	cmd/compile/internal/noder/writer.go:883 +0x318
        cmd/compile/internal/noder.(*pkgWriter).objIdx(0xc000528d00, {0x77e7760, 0xc0003edbc0})
        	cmd/compile/internal/noder/writer.go:815 +0x84b
        cmd/compile/internal/noder.(*pkgWriter).objInstIdx(0xc000528d00, {0x77e7760, 0xc0003edbc0}, 0x0, 0xc000183e00)
        	cmd/compile/internal/noder/writer.go:756 +0xf4
        cmd/compile/internal/noder.(*writer).obj(0xc0007334a0, {0x77e7760?, 0xc0003edbc0?}, 0xc000554380?)
        	cmd/compile/internal/noder/writer.go:730 +0x33
        cmd/compile/internal/noder.(*writer).namedType(0xc0007334a0, 0xc0003edbc0, 0x0)
        	cmd/compile/internal/noder/writer.go:631 +0x52
        cmd/compile/internal/noder.(*pkgWriter).typIdx(0xc000528d00, {0x77df9a8, 0xc000554380}, 0xc000183e00)
        	cmd/compile/internal/noder/writer.go:550 +0x8cc
        cmd/compile/internal/noder.(*writer).typ(0xc000733290, {0x77df9a8?, 0xc000554380?})
        	cmd/compile/internal/noder/writer.go:481 +0x2f
        cmd/compile/internal/noder.(*writer).objDict(0xc000733290, {0x77e7800, 0xc00054e620}, 0xc000183e00)
        	cmd/compile/internal/noder/writer.go:914 +0xea
        cmd/compile/internal/noder.(*pkgWriter).objIdx(0xc000528d00, {0x77e7800, 0xc00054e620})
        	cmd/compile/internal/noder/writer.go:823 +0x8ff
        cmd/compile/internal/noder.(*pkgWriter).objInstIdx(0xc000528d00, {0x77e7800, 0xc00054e620}, 0x0, 0x0)
        	cmd/compile/internal/noder/writer.go:756 +0xf4
        cmd/compile/internal/noder.(*writer).obj(0xc0001a29a0, {0x77e7800?, 0xc00054e620?}, 0x0?)
        	cmd/compile/internal/noder/writer.go:730 +0x33
        cmd/compile/internal/noder.writePkgStub({0x0?, {0x0?, 0x0?}}, {0xc000431200, 0x7, 0x7})
        	cmd/compile/internal/noder/unified.go:343 +0x6fa
        cmd/compile/internal/noder.unified({0x0?, {0x0?, 0x0?}}, {0xc000431200?, 0x770eaa0?, 0x0?})
        	cmd/compile/internal/noder/unified.go:195 +0xb3
        cmd/compile/internal/noder.LoadPackage({0xc000022460, 0x7, 0x8})
        	cmd/compile/internal/noder/noder.go:77 +0x43a
        cmd/compile/internal/gc.Main(0x77d76e0)
        	cmd/compile/internal/gc/main.go:208 +0xcc5
        main.main()
        	cmd/compile/main.go:57 +0xf9
        
--- FAIL: TestVetStdlib (310.69s)
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jan 27, 2025
@adonovan adonovan added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 27, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Jan 27, 2025
@mknyszek
Copy link
Contributor

mknyszek commented Feb 5, 2025

This build ran on a different machine from the one that was causing quite a few memory corruption flakes. This might be real, or we might have another bad machine in the pool.

(It could also be a broader issue with Darwin. This has happened in the past; the underlying infrastructure was flaky.)

@griesemer offered to take a look in triage.

@griesemer griesemer self-assigned this Feb 5, 2025
@mknyszek mknyszek added this to the Backlog milestone Feb 5, 2025
@mknyszek
Copy link
Contributor

mknyszek commented Feb 5, 2025

In triage, @ianlancetaylor is wondering why the compiler is running at all for go vet. @cherrymui suggests that it might be because it wants access to export data. @adonovan Do you know?

@adonovan
Copy link
Member Author

adonovan commented Feb 5, 2025

In triage, @ianlancetaylor is wondering why the compiler is running at all for go vet. @cherrymui suggests that it might be because it wants access to export data. @adonovan Do you know?

go vet runs cmd/vet, which uses x/tools/go/analysis/unitchecker to parse a list of files, import types for direct dependencies from export data, and run the analyzers. The go command ensures that export data exists by running the compiler.

(By contrast, the {single,multi}checker tools use x/tools/go/packages to load the entire program from source, so they don't invoke the compiler, but they are less efficient because there's no "separate analysis" (analogous to separate compilation) with file-based intermediaries.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

5 participants