cockroachdb / cockroachdb/cockroach
Sentry: catch.go:24: runtime error: invalid memory address or nil pointer dereference (1) Wraps: (2) assertion failure Wraps: (3) attached stack trace -- stack trace: | github.com/cockroachdb/cock...
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
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/7736234404/?referrer=webhooks_plugin](https://cockroach-labs.sentry.io/issues/7736234404/?referrer=webhooks_plugin)
Panic Message:
```
catch.go:24: runtime error: invalid memory address or nil pointer dereference
(1)
Wraps: (2) assertion failure
Wraps: (3) attached stack trace
-- stack trace:
| github.com/cockroachdb/cockroach/pkg/util/errorutil.ShouldCatch
| pkg/util/errorutil/catch.go:24
| github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain.DecodePlanGistToRows.func1
| pkg/sql/opt/exec/explain/plan_gist_factory.go:186
| runtime.gopanic
| GOROOT/src/runtime/panic.go:791
| runtime.panicmem
| GOROOT/src/runtime/panic.go:262
| runtime.sigpanic
| GOROOT/src/runtime/signal_unix.go:917
| github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain.(*Node).Columns
| pkg/sql/opt/exec/explain/explain_factory.go:67
| github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain.(*emitter).emitNodeAttributes
| pkg/sql/opt/exec/explain/emit.go:816
| github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain.emitInternal.func1
| pkg/sql/opt/exec/explain/emit.go:94
| github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain.emitInternal.func1
| pkg/sql/opt/exec/explain/emit.go:98
| github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain.emitInternal.func1
| pkg/sql/opt/exec/explain/emit.go:98
| github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain.emitInternal.func1
| pkg/sql/opt/exec/explain/emit.go:85
| github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain.emitInternal
| pkg/sql/opt/exec/explain/emit.go:108
| github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain.Emit
| pkg/sql/opt/exec/explain/emit.go:41
| github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain.DecodePlanGistToRows
| pkg/sql/opt/exec/explain/plan_gist_factory.go:202
| github.com/cockroachdb/cockroach/pkg/sql.(*planner).DecodeGist
| pkg/sql/plan_opt.go:997
| github.com/cockroachdb/cockroach/pkg/sql/sem/builtins.(*gistPlanGenerator).Start
| pkg/sql/sem/builtins/generator_builtins.go:790
| github.com/cockroachdb/cockroach/pkg/sql/rowexec.(*projectSetProcessor).nextInputRow
| pkg/sql/rowexec/project_set.go:207
| github.com/cockroachdb/cockroach/pkg/sql/rowexec.(*projectSetProcessor).Next
| pkg/sql/rowexec/project_set.go:301
| github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Columnarizer).Next
| pkg/sql/colexec/columnarizer.go:248
| github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next
| pkg/sql/colexec/colexecutils/operator.go:152
| github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.constBytesOp.Next
| bazel-out/k8-opt/bin/pkg/sql/colexec/colexecbase/const.eg.go:208
| github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.(*simpleProjectOp).Next
| pkg/sql/colexec/colexecbase/simple_project.go:113
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*batchInfoCollector).next
| pkg/sql/colflow/stats.go:120
| github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError
| pkg/sql/colexecerror/error.go:162
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*batchInfoCollector).Next
| pkg/sql/colflow/stats.go:128
| github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.(*fnOp).Next
| pkg/sql/colexec/colexecbase/fn_op.go:27
| github.com/cockroachdb/cockroach/pkg/sql/colexec.(*orderedAggregator).Next
| pkg/sql/colexec/ordered_aggregator.go:204
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*batchInfoCollector).next
| pkg/sql/colflow/stats.go:120
| github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError
| pkg/sql/colexecerror/error.go:162
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*batchInfoCollector).Next
| pkg/sql/colflow/stats.go:128
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*BatchFlowCoordinator).nextAdapter
| pkg/sql/colflow/flow_coordinator.go:241
| github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError
| pkg/sql/colexecerror/error.go:162
Wraps: (4) runtime error: invalid memory address or nil pointer dereference
| -- cause hidden behind barrier
| runtime error: invalid memory address or nil pointer dereference
| (1) runtime error: invalid memory address or nil pointer dereference
| Error types: (1) runtime.errorString
Error types: (1) *colexecerror.notInternalError (2) *assert.withAssertionFailure (3) *withstack.withStack (4) *barriers.barrierErr
-- report composition:
*barriers.barrierErr: masked error: runtime error: invalid memory address or nil pointer dereference
catch.go:24: *withstack.withStack (top exception)
*assert.withAssertionFailure
*colexecerror.notInternalError
```
Stacktrace (expand for inline code snippets):
[pkg/sql/colexecerror/error.go#L161-L163](pkg/sql/colexecerror/error.go#L161-L163)
[pkg/sql/colflow/flow_coordinator.go#L240-L242](pkg/sql/colflow/flow_coordinator.go#L240-L242)
[pkg/sql/colflow/stats.go#L127-L129](pkg/sql/colflow/stats.go#L127-L129)
[pkg/sql/colexecerror/error.go#L161-L163](pkg/sql/colexecerror/error.go#L161-L163)
[pkg/sql/colflow/stats.go#L119-L121](pkg/sql/colflow/stats.go#L119-L121)
[pkg/sql/colexec/ordered_aggregator.go#L203-L205](pkg/sql/colexec/ordered_aggregator.go#L203-L205)
[pkg/sql/colexec/colexecbase/fn_op.go#L26-L28](pkg/sql/colexec/colexecbase/fn_op.go#L26-L28)
[pkg/sql/colflow/stats.go#L127-L129](pkg/sql/colflow/stats.go#L127-L129)
[pkg/sql/colexecerror/error.go#L161-L163](pkg/sql/colexecerror/error.go#L161-L163)
[pkg/sql/colflow/stats.go#L119-L121](pkg/sql/colflow/stats.go#L119-L121)
[pkg/sql/colexec/colexecbase/simple_project.go#L112-L114](pkg/sql/colexec/colexecbase/simple_project.go#L112-L114)
[bazel-out/k8-opt/bin/pkg/sql/colexec/colexecbase/const.eg.go#L207-L209](bazel-out/k8-opt/bin/pkg/sql/colexec/colexecbase/const.eg.go#L207-L209)
[pkg/sql/colexec/colexecutils/operator.go#L151-L153](pkg/sql/colexec/colexecutils/operator.go#L151-L153)
[pkg/sql/colexec/columnarizer.go#L247-L249](pkg/sql/colexec/columnarizer.go#L247-L249)
[pkg/sql/rowexec/project_set.go#L300-L302](pkg/sql/rowexec/project_set.go#L300-L302)
[pkg/sql/rowexec/project_set.go#L206-L208](pkg/sql/rowexec/project_set.go#L206-L208)
[pkg/sql/sem/builtins/generator_builtins.go#L789-L791](pkg/sql/sem/builtins/generator_builtins.go#L789-L791)
[pkg/sql/plan_opt.go#L996-L998](pkg/sql/plan_opt.go#L996-L998)
[pkg/sql/opt/exec/explain/plan_gist_factory.go#L201-L203](pkg/sql/opt/exec/explain/plan_gist_factory.go#L201-L203)
[pkg/sql/opt/exec/explain/emit.go#L40-L42](pkg/sql/opt/exec/explain/emit.go#L40-L42)
[pkg/sql/opt/exec/explain/emit.go#L107-L109](pkg/sql/opt/exec/explain/emit.go#L107-L109)
[pkg/sql/opt/exec/explain/emit.go#L84-L86](pkg/sql/opt/exec/explain/emit.go#L84-L86)
[pkg/sql/opt/exec/explain/emit.go#L97-L99](pkg/sql/opt/exec/explain/emit.go#L97-L99)
[pkg/sql/opt/exec/explain/emit.go#L97-L99](pkg/sql/opt/exec/explain/emit.go#L97-L99)
[pkg/sql/opt/exec/explain/emit.go#L93-L95](pkg/sql/opt/exec/explain/emit.go#L93-L95)
[pkg/sql/opt/exec/explain/emit.go#L815-L817](pkg/sql/opt/exec/explain/emit.go#L815-L817)
[pkg/sql/opt/exec/explain/explain_factory.go#L66-L68](pkg/sql/opt/exec/explain/explain_factory.go#L66-L68)
[GOROOT/src/runtime/signal_unix.go#L916-L918](GOROOT/src/runtime/signal_unix.go#L916-L918)
[GOROOT/src/runtime/panic.go#L261-L263](GOROOT/src/runtime/panic.go#L261-L263)
[GOROOT/src/runtime/panic.go#L790-L792](GOROOT/src/runtime/panic.go#L790-L792)
[pkg/sql/opt/exec/explain/plan_gist_factory.go#L185-L187](pkg/sql/opt/exec/explain/plan_gist_factory.go#L185-L187)
[pkg/util/errorutil/catch.go#L23-L25](pkg/util/errorutil/catch.go#L23-L25)
```
pkg/sql/colexecerror/error.go in pkg/sql/colexecerror.CatchVectorizedRuntimeError at line 162
pkg/sql/colflow/flow_coordinator.go in pkg/sql/colflow.(*BatchFlowCoordinator).nextAdapter at line 241
pkg/sql/colflow/stats.go in pkg/sql/colflow.(*batchInfoCollector).Next at line 128
pkg/sql/colexecerror/error.go in pkg/sql/colexecerror.CatchVectorizedRuntimeError at line 162
pkg/sql/colflow/stats.go in pkg/sql/colflow.(*batchInfoCollector).next at line 120
pkg/sql/colexec/ordered_aggregator.go in pkg/sql/colexec.(*orderedAggregator).Next at line 204
pkg/sql/colexec/colexecbase/fn_op.go in pkg/sql/colexec/colexecbase.(*fnOp).Next at line 27
pkg/sql/colflow/stats.go in pkg/sql/colflow.(*batchInfoCollector).Next at line 128
pkg/sql/colexecerror/error.go in pkg/sql/colexecerror.CatchVectorizedRuntimeError at line 162
pkg/sql/colflow/stats.go in pkg/sql/colflow.(*batchInfoCollector).next at line 120
pkg/sql/colexec/colexecbase/simple_project.go in pkg/sql/colexec/colexecbase.(*simpleProjectOp).Next at line 113
bazel-out/k8-opt/bin/pkg/sql/colexec/colexecbase/const.eg.go in pkg/sql/colexec/colexecbase.constBytesOp.Next at line 208
pkg/sql/colexec/colexecutils/operator.go in pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next at line 152
pkg/sql/colexec/columnarizer.go in pkg/sql/colexec.(*Columnarizer).Next at line 248
pkg/sql/rowexec/project_set.go in pkg/sql/rowexec.(*projectSetProcessor).Next at line 301
pkg/sql/rowexec/project_set.go in pkg/sql/rowexec.(*projectSetProcessor).nextInputRow at line 207
pkg/sql/sem/builtins/generator_builtins.go in pkg/sql/sem/builtins.(*gistPlanGenerator).Start at line 790
pkg/sql/plan_opt.go in pkg/sql.(*planner).DecodeGist at line 997
pkg/sql/opt/exec/explain/plan_gist_factory.go in pkg/sql/opt/exec/explain.DecodePlanGistToRows at line 202
pkg/sql/opt/exec/explain/emit.go in pkg/sql/opt/exec/explain.Emit at line 41
pkg/sql/opt/exec/explain/emit.go in pkg/sql/opt/exec/explain.emitInternal at line 108
pkg/sql/opt/exec/explain/emit.go in pkg/sql/opt/exec/explain.emitInternal.func1 at line 85
pkg/sql/opt/exec/explain/emit.go in pkg/sql/opt/exec/explain.emitInternal.func1 at line 98
pkg/sql/opt/exec/explain/emit.go in pkg/sql/opt/exec/explain.emitInternal.func1 at line 98
pkg/sql/opt/exec/explain/emit.go in pkg/sql/opt/exec/explain.emitInternal.func1 at line 94
pkg/sql/opt/exec/explain/emit.go in pkg/sql/opt/exec/explain.(*emitter).emitNodeAttributes at line 816
pkg/sql/opt/exec/explain/explain_factory.go in pkg/sql/opt/exec/explain.(*Node).Columns at line 67
GOROOT/src/runtime/signal_unix.go in runtime.sigpanic at line 917
GOROOT/src/runtime/panic.go in runtime.panicmem at line 262
GOROOT/src/runtime/panic.go in runtime.gopanic at line 791
pkg/sql/opt/exec/explain/plan_gist_factory.go in pkg/sql/opt/exec/explain.DecodePlanGistToRows.func1 at line 186
pkg/util/errorutil/catch.go in pkg/util/errorutil.ShouldCatch at line 24
```
### Tags
| Tag | Value |
| --- | --- |
| Command | server |
| Environment | v25.2.18 |
| Go Version | go1.23.12 X:nocoverageredesign |
| Platform | linux arm64 |
| Distribution | CCL |
| Cockroach Release | v25.2.18 |
| Cockroach SHA | 54a229b1303a2ce8573241ee2dd159fa6c7c5bbb |
| # of CPUs | 8 |
| # of Goroutines | 2632 |
Jira issue: CRDB-68462
Contributor guide
Research direction
Start with pkg/sql/opt/exec/explain/explain_factory.go at Node.Columns and trace its caller in plan_gist_factory.go through DecodePlanGistToRows. Use the Sentry stack and linked source locations to understand how the plan-gist path reaches emit.go. Done means the reported plan-gist workload no longer triggers the nil-pointer panic and the behavior is covered by an appropriate regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100