- 
                Notifications
    
You must be signed in to change notification settings  - Fork 18.4k
 
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/memory-corruption"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)
Milestone
Description
Observed on a gotip-darwin-arm64 builder.
All failed tests belong to the same process, so it's possible that all are accessing the same shared file content (e.g. the LRU cache) that was corrupted once after being read correctly from the file cache. So this could be a memory error. If we had evidence that multiple processes were affected this would be a different story (but the filecache does an integrity check on read, so this seems impossible).
--- FAIL: TestCheck (2.35s)
    integration_test.go:131: gopls check ./a.go: exited with code 2, want success: true (gopls check ./a.go: exit=2 stdout=<<>> stderr=<<panic: surplus bytes
        
        goroutine 1089 [running]:
        golang.org/x/tools/gopls/internal/util/frob.(*frob).Decode(0x26e0b6411e00, {0x26e0be4a3400, 0x8, 0x200}, {0x1050ebb60?, 0x26e0b5f75b58?})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:252 +0x194
        golang.org/x/tools/gopls/internal/util/frob.Codec[...].Decode(...)
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:52
        golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0x26e0bdc51290, {0x105322710, 0x26e0bdc431a0}, {0x92, 0x77, 0xc4, 0x58, 0x41, 0x82, 0xdc, ...})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:588 +0x1d0
        golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:340 +0x3f4
        golang.org/x/sync/errgroup.(*Group).Go.func1()
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x4c
        created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1082
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x98
        >>)
    integration_test.go:132: gopls check ./a.go: stdout does not match [fmt.Sprintf format %s has arg 123 of wrong type int]; got <<>>
    integration_test.go:138: gopls check ./a.go ./b.go: exited with code 2, want success: true (gopls check ./a.go ./b.go: exit=2 stdout=<<>> stderr=<<panic: surplus bytes
        
        goroutine 982 [running]:
        golang.org/x/tools/gopls/internal/util/frob.(*frob).Decode(0x30c71b6737d0, {0x30c7232cee00, 0x8, 0x200}, {0x1013a7b60?, 0x30c71b5f37e8?})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:252 +0x194
        golang.org/x/tools/gopls/internal/util/frob.Codec[...].Decode(...)
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:52
        golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0x30c7231e64d0, {0x1015de710, 0x30c723062180}, {0x92, 0x77, 0xc4, 0x58, 0x41, 0x82, 0xdc, ...})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:588 +0x1d0
        golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:340 +0x3f4
        golang.org/x/sync/errgroup.(*Group).Go.func1()
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x4c
        created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 947
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x98
        >>)
    integration_test.go:139: gopls check ./a.go ./b.go: stdout does not match [a.go:.* fmt.Sprintf format %s has arg 123 of wrong type int]; got <<>>
    integration_test.go:140: gopls check ./a.go ./b.go: stdout does not match [b.go:.* fmt.Sprintf format %d has arg "123" of wrong type string]; got <<>>
--- FAIL: TestCodeLens (5.85s)
    integration_test.go:245: gopls codelens -exec ./a/a_test.go:1 nope: stderr does not match [no code lens at .* with title "nope"]; got <<panic: surplus bytes
        
        goroutine 1072 [running]:
        golang.org/x/tools/gopls/internal/util/frob.(*frob).Decode(0x4c126d7e0240, {0x4c127580a800, 0x8, 0x200}, {0x103217b60?, 0x4c126d3c1450?})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:252 +0x194
        golang.org/x/tools/gopls/internal/util/frob.Codec[...].Decode(...)
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:52
        golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0x4c12753f6000, {0x10344e710, 0x4c12753b1950}, {0x92, 0x77, 0xc4, 0x58, 0x41, 0x82, 0xdc, ...})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:588 +0x1d0
        golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:340 +0x3f4
        golang.org/x/sync/errgroup.(*Group).Go.func1()
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x4c
        created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1071
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x98
        >>
    integration_test.go:250: gopls -v codelens -exec ./a/a_test.go:3 run test: exited with code 2, want success: true (gopls -v codelens -exec ./a/a_test.go:3 run test: exit=2 stdout=<<>> stderr=<<2025/10/28 18:24:50 Info:2025/10/28 18:24:50 Created View (#1)
        	directory=.
        	view_type="GoMod"
        	root_dir="file://."
        	go_version="go version go1.26-devel_041f564b3e6fa3f4af13a01b94db14c1ee8a42e0 darwin/arm64"
        	build_flags=[]
        	env={GOOS:darwin GOARCH:arm64 GOCACHE:/Users/swarming/.swarming/w/ir/x/w/gocache GOMODCACHE:/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod GOPATH:/Users/swarming/.swarming/w/ir/x/w/gopath GOPRIVATE: GOFLAGS: GO111MODULE: GOTOOLCHAIN:local GOROOT:/Users/swarming/.swarming/w/ir/x/w/goroot GoVersion:26 GoVersionOutput:go version go1.26-devel_041f564b3e6fa3f4af13a01b94db14c1ee8a42e0 darwin/arm64
         ExplicitGOWORK: EffectiveGOPACKAGESDRIVER:}
        	env_overlay=[]
        2025/10/28 18:24:50 Info:2025/10/28 18:24:50 go/packages.Load #1
        	view_id="1"
        	snapshot=0
        	directory=.
        	query=[./... builtin]
        	packages=4
        	duration=68.123833ms
        === RUN   TestPass
        --- PASS: TestPass (0.00s)
        PASS
        ok  	example.com/a	0.006s
        Info: all tests passed
        panic: surplus bytes
        
        goroutine 1023 [running]:
        golang.org/x/tools/gopls/internal/util/frob.(*frob).Decode(0x32f81f299770, {0x32f8270abc00, 0x8, 0x200}, {0x1054bfb60?, 0x32f81ee33840?})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:252 +0x194
        golang.org/x/tools/gopls/internal/util/frob.Codec[...].Decode(...)
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:52
        golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0x32f827085130, {0x1056f6710, 0x32f827073a70}, {0x92, 0x77, 0xc4, 0x58, 0x41, 0x82, 0xdc, ...})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:588 +0x1d0
        golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:340 +0x3f4
        golang.org/x/sync/errgroup.(*Group).Go.func1()
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x4c
        created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1047
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x98
        >>)
--- FAIL: TestDefinition (4.00s)
    integration_test.go:291: gopls definition a.go:7:2: exited with code 2, want success: true (gopls definition a.go:7:2: exit=2 stdout=<<./a.go:3:6-7: defined here as func f()
        >> stderr=<<panic: surplus bytes
        
        goroutine 1084 [running]:
        golang.org/x/tools/gopls/internal/util/frob.(*frob).Decode(0x3f17b60ff470, {0x3f17bdc7c600, 0x8, 0x200}, {0x101a27b60?, 0x3f17bd4234f8?})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:252 +0x194
        golang.org/x/tools/gopls/internal/util/frob.Codec[...].Decode(...)
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:52
        golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0x3f17bde0c4d0, {0x101c5e710, 0x3f17bdbea210}, {0x92, 0x77, 0xc4, 0x58, 0x41, 0x82, 0xdc, ...})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:588 +0x1d0
        golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:340 +0x3f4
        golang.org/x/sync/errgroup.(*Group).Go.func1()
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x4c
        created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1073
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x98
        >>)
    integration_test.go:297: gopls definition a.go:4:7: exited with code 2, want success: true (gopls definition a.go:4:7: exit=2 stdout=<</Users/swarming/.swarming/w/ir/x/w/goroot/src/fmt/print.go:313:6-13: defined here as func fmt.Println(a ...any) (n int, err error)
        Println formats using the default formats for its operands and writes to standard output.
        Spaces are always added between operands and a newline is appended.
        It returns the number of bytes written and any write error encountered.
        >> stderr=<<panic: surplus bytes
        
        goroutine 1108 [running]:
        golang.org/x/tools/gopls/internal/util/frob.(*frob).Decode(0xf49d51c66f0, {0xf49dd5da200, 0x8, 0x200}, {0x101a2bb60?, 0xf49dd5c6138?})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:252 +0x194
        golang.org/x/tools/gopls/internal/util/frob.Codec[...].Decode(...)
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:52
        golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0xf49ddb88210, {0x101c62710, 0xf49ddb2d770}, {0x92, 0x77, 0xc4, 0x58, 0x41, 0x82, 0xdc, ...})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:588 +0x1d0
        golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:340 +0x3f4
        golang.org/x/sync/errgroup.(*Group).Go.func1()
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x4c
        created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 989
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x98
        >>)
    integration_test.go:304: gopls definition -json -markdown a.go:4:7: exited with code 2, want success: true (gopls definition -json -markdown a.go:4:7: exit=2 stdout=<<{
        	"span": {
        		"uri": "file:///Users/swarming/.swarming/w/ir/x/w/goroot/src/fmt/print.go",
        		"start": {
        			"line": 313,
        			"column": 6,
        			"offset": 9437
        		},
        		"end": {
        			"line": 313,
        			"column": 13,
        			"offset": 9444
        		}
        	},
        	"description": "```go\nfunc fmt.Println(a ...any) (n int, err error)\n```\n\n---\n\nPrintln formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the number of bytes written and any write error encountered.\n\n\n---\n\n[`fmt.Println` on pkg.go.dev](https://pkg.go.dev/fmt#Println)"
        }
        >> stderr=<<panic: surplus bytes
        
        goroutine 1111 [running]:
        golang.org/x/tools/gopls/internal/util/frob.(*frob).Decode(0x658ec8ceb9b0, {0x658ed190ec00, 0x8, 0x200}, {0x10390bb60?, 0x658ed0fc2b20?})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:252 +0x194
        golang.org/x/tools/gopls/internal/util/frob.Codec[...].Decode(...)
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:52
        golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0x658ed0ff22c0, {0x103b42710, 0x658ed1816390}, {0x92, 0x77, 0xc4, 0x58, 0x41, 0x82, 0xdc, ...})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:588 +0x1d0
        golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:340 +0x3f4
        golang.org/x/sync/errgroup.(*Group).Go.func1()
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x4c
        created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1107
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x98
        >>)
--- FAIL: TestReferences (1.31s)
    integration_test.go:662: gopls references a.go:4:10: exited with code 2, want success: true (gopls references a.go:4:10: exit=2 stdout=<<./a.go:4:6-13
        ./b.go:4:6-13
        >> stderr=<<panic: surplus bytes
        
        goroutine 1115 [running]:
        golang.org/x/tools/gopls/internal/util/frob.(*frob).Decode(0x5f293a629cb0, {0x5f2942e2e800, 0x8, 0x200}, {0x101917b60?, 0x5f29415e5638?})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:252 +0x194
        golang.org/x/tools/gopls/internal/util/frob.Codec[...].Decode(...)
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:52
        golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0x5f2942e0cc60, {0x101b4e710, 0x5f2942dbb560}, {0x92, 0x77, 0xc4, 0x58, 0x41, 0x82, 0xdc, ...})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:588 +0x1d0
        golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:340 +0x3f4
        golang.org/x/sync/errgroup.(*Group).Go.func1()
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x4c
        created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1112
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x98
        >>)
--- FAIL: TestSignature (1.35s)
    integration_test.go:693: gopls signature a.go:4:15: exited with code 2, want success: true (gopls signature a.go:4:15: exit=2 stdout=<<Println(a ...any) (n int, err error)
        
        Println formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the number of bytes written and any write error encountered.
        >> stderr=<<panic: surplus bytes
        
        goroutine 712 [running]:
        golang.org/x/tools/gopls/internal/util/frob.(*frob).Decode(0x3b748f9eab40, {0x3b74972e6e00, 0x8, 0x200}, {0x103d23b60?, 0x3b7496c4def8?})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:252 +0x194
        golang.org/x/tools/gopls/internal/util/frob.Codec[...].Decode(...)
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/util/frob/frob.go:52
        golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0x3b7497758e70, {0x103f5a710, 0x3b74974f7650}, {0x92, 0x77, 0xc4, 0x58, 0x41, 0x82, 0xdc, ...})
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:588 +0x1d0
        golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
        	/Users/swarming/.swarming/w/ir/x/w/targetrepo3325812423/gopls/internal/cache/analysis.go:340 +0x3f4
        golang.org/x/sync/errgroup.(*Group).Go.func1()
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x4c
        created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 154
        	/Users/swarming/.swarming/w/ir/x/w/gopath/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x98
        >>)
FAIL
FAIL	golang.org/x/tools/gopls/internal/cmd	15.926s
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/memory-corruption"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)"can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)