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

server: v23.1.8: index out of range in CPU sampling #120129

Closed
cockroach-sentry opened this issue Mar 8, 2024 · 0 comments · Fixed by #123891
Closed

server: v23.1.8: index out of range in CPU sampling #120129

cockroach-sentry opened this issue Mar 8, 2024 · 0 comments · Fixed by #123891
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report. T-observability

Comments

@cockroach-sentry
Copy link
Collaborator

cockroach-sentry commented Mar 8, 2024

This issue was auto filed by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.

Sentry Link: https://cockroach-labs.sentry.io/issues/5047525090/?referrer=webhooks_plugin

Panic Message:

panic.go:884: runtime error: index out of range [0] with length 0
(1) attached stack trace
  -- stack trace:
  | runtime.gopanic
  | 	GOROOT/src/runtime/panic.go:884
  | runtime.goPanicIndex
  | 	GOROOT/src/runtime/panic.go:113
  | github.com/cockroachdb/cockroach/pkg/server/status.(*RuntimeStatSampler).SampleEnvironment
  | 	github.com/cockroachdb/cockroach/pkg/server/status/runtime.go:499
  | github.com/cockroachdb/cockroach/pkg/server.startSampleEnvironment.func1
  | 	github.com/cockroachdb/cockroach/pkg/server/env_sampler.go:186
  | github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2
  | 	github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:470
  | runtime.goexit
  | 	GOROOT/src/runtime/asm_amd64.s:1594
Wraps: (2) runtime error: index out of range [0] with length 0
Error types: (1) *withstack.withStack (2) runtime.boundsError
-- report composition:
runtime.boundsError
panic.go:884: *withstack.withStack (top exception)
Stacktrace (expand for inline code snippets):

GOROOT/src/runtime/asm_amd64.s#L1593-L1595

sp.UpdateGoroutineIDToCurrent()
f(ctx)
}()

cgoStats := status.GetCGoMemStats(ctx)
cfg.runtime.SampleEnvironment(ctx, curStats, cgoStats)

}
cpuUsage := cpuUsageStats[0]
numHostCPUs, err := cpu.Counts(true /* logical */)

GOROOT/src/runtime/panic.go#L112-L114
GOROOT/src/runtime/panic.go#L883-L885

GOROOT/src/runtime/asm_amd64.s in runtime.goexit at line 1594
pkg/util/stop/stopper.go in pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2 at line 470
pkg/server/env_sampler.go in pkg/server.startSampleEnvironment.func1 at line 186
pkg/server/status/runtime.go in pkg/server/status.(*RuntimeStatSampler).SampleEnvironment at line 499
GOROOT/src/runtime/panic.go in runtime.goPanicIndex at line 113
GOROOT/src/runtime/panic.go in runtime.gopanic at line 884

Tags

Tag Value
Command start-single-node
Environment v23.1.8
Go Version go1.19.10
Platform linux amd64
Distribution CCL
Cockroach Release v23.1.8
Cockroach SHA 2c1d4af
# of CPUs 16
# of Goroutines 518

Jira issue: CRDB-36502

@cockroach-sentry cockroach-sentry added O-sentry Originated from an in-the-wild panic report. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels Mar 8, 2024
@exalate-issue-sync exalate-issue-sync bot changed the title Sentry: panic.go:884: runtime error: index out of range [0] with length 0 (1) attached stack trace -- stack trace: | runtime.gopanic | GOROOT/src/runtime/panic.go:884 | runtime.goPanicIndex ... Sentry: panic.go:884: runtime error: index out of range [0] with length 0 (1) attached stack trace -- stack trace: | runtime.gopanic | GOROOT/src/runtime/panic.go:884 | runtime.goPanicIndex ... Mar 8, 2024
@yuzefovich yuzefovich changed the title Sentry: panic.go:884: runtime error: index out of range [0] with length 0 (1) attached stack trace -- stack trace: | runtime.gopanic | GOROOT/src/runtime/panic.go:884 | runtime.goPanicIndex ... server: v23.1.8: index out of range in CPU sampling May 4, 2024
@yuzefovich yuzefovich added this to To do in DB Server & Security via automation May 4, 2024
@blathers-crl blathers-crl bot added the T-server-and-security DB Server & Security label May 4, 2024
@exalate-issue-sync exalate-issue-sync bot removed the T-server-and-security DB Server & Security label May 4, 2024
@craig craig bot closed this as completed in bf7788e May 9, 2024
DB Server & Security automation moved this from To do to Done 21.2 May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report. T-observability
Projects
DB Server & Security
  
Done 21.2
Development

Successfully merging a pull request may close this issue.

2 participants