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

x/tools/gopls: nil panic loading actionSummary.Err #66788

Open
ElianMartinez opened this issue Apr 3, 2024 · 2 comments
Open

x/tools/gopls: nil panic loading actionSummary.Err #66788

ElianMartinez opened this issue Apr 3, 2024 · 2 comments
Labels
gopls/analysis Issues related to running analysis in gopls gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ElianMartinez
Copy link

gopls version: v0.15.2/go1.22.0
gopls flags:
update flags: proxy
extension version: 0.41.2
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Wed, 03 Apr 2024 02:58:36 GMT
restart history:
Wed, 03 Apr 2024 02:58:28 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x58 pc=0x102c8263c]

goroutine 2858 [running]:
golang.org/x/tools/gopls/internal/cache.(*action).exec(0x1400058f800)
	  analysis.go:1185  0xac
golang.org/x/tools/gopls/internal/cache.execActions.func1.1()
	  analysis.go:1149  0x38
sync.(*Once).doSlow(0x0%3F, 0x0%3F)
	  once.go:74  0x100
sync.(*Once).Do(...)
	  once.go:65
golang.org/x/tools/gopls/internal/cache.execActions.func1()
	  analysis.go:1147  0x78
created by golang.org/x/tools/gopls/internal/cache.execActions in goroutine 2853
	  analysis.go:1145  0x44
gopls stats -anon { "DirStats": { "Files": 879, "TestdataFiles": 0, "GoFiles": 26, "ModFiles": 1, "Dirs": 286 }, "GOARCH": "arm64", "GOOS": "darwin", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.22.0", "GoplsVersion": "v0.15.2", "InitialWorkspaceLoadDuration": "289.011584ms", "MemStats": { "HeapAlloc": 24062608, "HeapInUse": 33005568, "TotalAlloc": 47871456 }, "WorkspaceStats": { "Files": { "Total": 1411, "Largest": 1849364, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.0", "AllPackages": { "Packages": 248, "LargestPackage": 155, "CompiledGoFiles": 1406, "Modules": 15 }, "WorkspacePackages": { "Packages": 10, "LargestPackage": 7, "CompiledGoFiles": 25, "Modules": 1 }, "Diagnostics": 0 } ] } }

OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.

NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.

<OPTIONAL: ATTACH LOGS HERE>

@findleyr
Copy link
Contributor

findleyr commented Apr 3, 2024

CC @adonovan

This looks like a nil analysisNode.summary. I think we've looked into similar issues in the past, and not yet determined how this is possible.

@ElianMartinez is this reproducible for you?

@adonovan
Copy link
Member

Confirming that it's the actionSummary that's nil, not the analysisNode.summary, so it's a distinct variant from #66732:

  0x100602630           911a0000                ADD $1664, R0, R0                       
  0x100602634           97e84de7                CALL runtime.mapaccess1_faststr(SB)     
  0x100602638           f9400004                MOVD (R0), R4                           
  0x10060263c           f9402c85                MOVD 88(R4), R5          <--- SEGV loading data field of summ.Err string                
  0x100602640           b4fffe05                CBZ R5, -16(PC)                         
  0x100602644           f90063e5                MOVD R5, 192(RSP)                       
	// Report an error if any action dependency (vertical or horizontal) failed.
	// To avoid long error messages describing chains of failure,
	// we return the dependencies' error' unadorned.
	if hasFacts {
		// TODO(adonovan): use deterministic order.
		for _, vdep := range act.vdeps {
			if summ := vdep.summary.Actions[act.stableName]; summ.Err != "" { // summ.Err panics
				return nil, nil, errors.New(summ.Err)
			}
		}
	}

@adonovan adonovan changed the title gopls: automated issue report (crash) x/tools/gopls: nil panic loading actionSummary.Err Apr 11, 2024
@adonovan adonovan transferred this issue from golang/vscode-go Apr 11, 2024
@adonovan adonovan added this to the gopls/v0.16.0 milestone Apr 11, 2024
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Apr 11, 2024
@adonovan adonovan added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. gopls Issues related to the Go language server, gopls. gopls/analysis Issues related to running analysis in gopls and removed gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls/analysis Issues related to running analysis in gopls gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants