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 deref in Exporter.ProcessEvent #71928

Open
adonovan opened this issue Feb 24, 2025 · 2 comments
Open

x/tools/gopls: nil deref in Exporter.ProcessEvent #71928

adonovan opened this issue Feb 24, 2025 · 2 comments
Labels
BugReport Issues describing a possible bug in the Go implementation. gopls/telemetry-wins 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. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan adonovan added gopls Issues related to the Go language server, gopls. gopls/telemetry-wins NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository. labels Feb 24, 2025
@gopherbot gopherbot added this to the Unreleased milestone Feb 24, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Feb 24, 2025
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.19.0 Feb 24, 2025
@adonovan
Copy link
Member Author

The panic is here:

func (data *HistogramInt64Data) Handle() string          { return data.Info.Name }

which means that either data is nil or data.Info is nil. The latter cannot be the case because the only place that HistogramInt64Data variables are constructed are this function:

func (info HistogramInt64) Record(e *Config, key *keys.Int64) {
	data := &HistogramInt64Data{Info: &info, key: key}
	e.subscribe(key, data.record)
}

which ensures that info is non-nil, and HistogramInt64Data.modify, which returns a non-nil data with a non-nil Info.

I also don't see any way a nil *HistogramInt64Data pointer can find its way into the prometheus.Exporter.metrics array.

Perhaps @ianthehat has ideas.

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. gopls/telemetry-wins 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. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants