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

sentry: catch.go:29: runtime error: invalid memory address or nil pointer dereference (1) assertion failure Wraps: (2) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/util/erro... #95539

Closed
cockroach-teamcity opened this issue Jan 19, 2023 · 1 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.

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Jan 19, 2023

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

Sentry link: https://sentry.io/organizations/cockroach-labs/issues/3885483048/?referrer=webhooks_plugin

Panic message:

catch.go:29: runtime error: invalid memory address or nil pointer dereference
(1) assertion failure
Wraps: (2) attached stack trace
-- stack trace:
| github.com/cockroachdb/cockroach/pkg/util/errorutil.ShouldCatch
| github.com/cockroachdb/cockroach/pkg/util/errorutil/catch.go:29
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).Build.func1
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:182
| runtime.gopanic
| GOROOT/src/runtime/panic.go:1038
| runtime.panicmem
| GOROOT/src/runtime/panic.go:221
| runtime.sigpanic
| GOROOT/src/runtime/signal_unix.go:735
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree.formatBitArrayToType
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree/cast.go:1699
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree.performCastWithoutPrecisionTruncation
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree/cast.go:1765
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree.PerformCast
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree/cast.go:1474
| github.com/cockroachdb/cockroach/pkg/sql/sem/builtins.glob..func269
| github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:5039
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*FuncExpr).Eval
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree/eval.go:4406
| github.com/cockroachdb/cockroach/pkg/sql/opt/norm.(*CustomFuncs).FoldFunction
| github.com/cockroachdb/cockroach/pkg/sql/opt/norm/fold_constants_funcs.go:623
| github.com/cockroachdb/cockroach/pkg/sql/opt/norm.(*Factory).ConstructFunction
| github.com/cockroachdb/cockroach/bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go:19890
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildFunction
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:543
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildScalar
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:322
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildScalar
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:310
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildScalar
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:122
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).resolveAndBuildScalar
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/util.go:454
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildWhere
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1101
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectClause
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:983
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:928
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:901
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).processWiths
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:115
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelect
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:900
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmt
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:281
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmt
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:373
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildDataSource
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:163
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildDataSource
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:60
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1155
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildFromTables
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1132
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildFrom
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1059
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectClause
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:980
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:928
Wraps: (3) 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) *assert.withAssertionFailure (2) *withstack.withStack (3) *barriers.barrierErr
-- report composition:
*barriers.barrierErr: masked error: runtime error: invalid memory address or nil pointer dereference
catch.go:29: *withstack.withStack (top exception)
*assert.withAssertionFailure

Stacktrace (expand for inline code snippets):

// get reported to Sentry.
err = errors.HandleAsAssertionFailure(err)
}
in pkg/util/errorutil.ShouldCatch
// manipulate locks.
if ok, e := errorutil.ShouldCatch(r); ok {
err = e
in pkg/sql/opt/optbuilder.(*Builder).Build.func1
GOROOT/src/runtime/panic.go#L1037-L1039 in runtime.gopanic
GOROOT/src/runtime/panic.go#L220-L222 in runtime.panicmem
GOROOT/src/runtime/signal_unix.go#L734-L736 in runtime.sigpanic
func formatBitArrayToType(d *DBitArray, t *types.T) *DBitArray {
if t.Width() == 0 || d.BitLen() == uint(t.Width()) {
return d
in pkg/sql/sem/tree.formatBitArrayToType
if truncateWidth {
ba = formatBitArrayToType(ba, t)
}
in pkg/sql/sem/tree.performCastWithoutPrecisionTruncation
func PerformCast(ctx *EvalContext, d Datum, t *types.T) (Datum, error) {
ret, err := performCastWithoutPrecisionTruncation(ctx, d, t, true /* truncateWidth */)
if err != nil {
in pkg/sql/sem/tree.PerformCast
expectedTyp := col.GetType()
newDatum, err = tree.PerformCast(ctx, d, expectedTyp)
if err != nil {
in pkg/sql/sem/builtins.glob..func269
res, err := expr.fn.Fn(ctx, args)
if err != nil {
in pkg/sql/sem/tree.(*FuncExpr).Eval
result, err := fn.Eval(c.f.evalCtx)
if err != nil {
in pkg/sql/opt/norm.(*CustomFuncs).FoldFunction
https://github.com/cockroachdb/cockroach/blob/8dfa17e26292e8589d246eaca9718e84fc85919a/bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go#L19889-L19891 in pkg/sql/opt/norm.(*Factory).ConstructFunction
// Construct a private FuncOpDef that refers to a resolved function overload.
out = b.factory.ConstructFunction(args, &memo.FunctionPrivate{
Name: def.Name,
in pkg/sql/opt/optbuilder.(*Builder).buildFunction
case *tree.FuncExpr:
return b.buildFunction(t, inScope, outScope, outCol, colRefs)
in pkg/sql/opt/optbuilder.(*Builder).buildScalar
left := b.buildScalar(t.TypedLeft(), inScope, nil, nil, colRefs)
right := b.buildScalar(t.TypedRight(), inScope, nil, nil, colRefs)
out = b.constructComparison(t, left, right)
in pkg/sql/opt/optbuilder.(*Builder).buildScalar
case *tree.AndExpr:
left := b.buildScalar(reType(t.TypedLeft(), types.Bool), inScope, nil, nil, colRefs)
right := b.buildScalar(reType(t.TypedRight(), types.Bool), inScope, nil, nil, colRefs)
in pkg/sql/opt/optbuilder.(*Builder).buildScalar
texpr := inScope.resolveAndRequireType(expr, requiredType)
return b.buildScalar(texpr, inScope, nil, nil, nil)
}
in pkg/sql/opt/optbuilder.(*Builder).resolveAndBuildScalar
filter := b.resolveAndBuildScalar(
where.Expr,
in pkg/sql/opt/optbuilder.(*Builder).buildWhere
b.processWindowDefs(sel, fromScope)
b.buildWhere(sel.Where, fromScope)
in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause
case *tree.SelectClause:
outScope = b.buildSelectClause(t, orderBy, locking, desiredTypes, inScope)
in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens
return b.processWiths(with, inScope, func(inScope *scope) *scope {
return b.buildSelectStmtWithoutParens(
wrapped, orderBy, limit, locking, desiredTypes, inScope,
in pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1
inScope.atRoot = false
outScope := buildStmt(inScope)
outScope.expr = b.buildWiths(outScope.expr, correlatedCTEs)
in pkg/sql/opt/optbuilder.(*Builder).processWiths
return b.processWiths(with, inScope, func(inScope *scope) *scope {
return b.buildSelectStmtWithoutParens(
in pkg/sql/opt/optbuilder.(*Builder).buildSelect
case *tree.Select:
return b.buildSelect(stmt, noRowLocking, desiredTypes, inScope)
in pkg/sql/opt/optbuilder.(*Builder).buildStmt
b.DisableMemoReuse = true
return b.buildStmt(newStmt, desiredTypes, inScope)
}
in pkg/sql/opt/optbuilder.(*Builder).buildStmt
emptyScope := b.allocScope()
innerScope := b.buildStmt(source.Statement, nil /* desiredTypes */, emptyScope)
if len(innerScope.cols) == 0 {
in pkg/sql/opt/optbuilder.(*Builder).buildDataSource
outScope = b.buildDataSource(source.Expr, indexFlags, locking, inScope)
in pkg/sql/opt/optbuilder.(*Builder).buildDataSource
) (outScope *scope) {
outScope = b.buildDataSource(tables[0], nil /* indexFlags */, locking, inScope)
in pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep
}
return b.buildFromTablesRightDeep(tables, locking, inScope)
}
in pkg/sql/opt/optbuilder.(*Builder).buildFromTables
if len(from.Tables) > 0 {
outScope = b.buildFromTables(from.Tables, locking, inScope)
} else {
in pkg/sql/opt/optbuilder.(*Builder).buildFrom
) (outScope *scope) {
fromScope := b.buildFrom(sel.From, locking, inScope)
in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause
case *tree.SelectClause:
outScope = b.buildSelectClause(t, orderBy, locking, desiredTypes, inScope)
in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens

pkg/util/errorutil/catch.go in pkg/util/errorutil.ShouldCatch at line 29
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).Build.func1 at line 182
GOROOT/src/runtime/panic.go in runtime.gopanic at line 1038
GOROOT/src/runtime/panic.go in runtime.panicmem at line 221
GOROOT/src/runtime/signal_unix.go in runtime.sigpanic at line 735
pkg/sql/sem/tree/cast.go in pkg/sql/sem/tree.formatBitArrayToType at line 1699
pkg/sql/sem/tree/cast.go in pkg/sql/sem/tree.performCastWithoutPrecisionTruncation at line 1765
pkg/sql/sem/tree/cast.go in pkg/sql/sem/tree.PerformCast at line 1474
pkg/sql/sem/builtins/builtins.go in pkg/sql/sem/builtins.glob..func269 at line 5039
pkg/sql/sem/tree/eval.go in pkg/sql/sem/tree.(*FuncExpr).Eval at line 4406
pkg/sql/opt/norm/fold_constants_funcs.go in pkg/sql/opt/norm.(*CustomFuncs).FoldFunction at line 623
bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go in pkg/sql/opt/norm.(*Factory).ConstructFunction at line 19890
pkg/sql/opt/optbuilder/scalar.go in pkg/sql/opt/optbuilder.(*Builder).buildFunction at line 543
pkg/sql/opt/optbuilder/scalar.go in pkg/sql/opt/optbuilder.(*Builder).buildScalar at line 322
pkg/sql/opt/optbuilder/scalar.go in pkg/sql/opt/optbuilder.(*Builder).buildScalar at line 310
pkg/sql/opt/optbuilder/scalar.go in pkg/sql/opt/optbuilder.(*Builder).buildScalar at line 122
pkg/sql/opt/optbuilder/util.go in pkg/sql/opt/optbuilder.(*Builder).resolveAndBuildScalar at line 454
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildWhere at line 1101
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause at line 983
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens at line 928
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1 at line 901
pkg/sql/opt/optbuilder/with.go in pkg/sql/opt/optbuilder.(*Builder).processWiths at line 115
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect at line 900
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 281
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 373
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 163
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 60
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep at line 1155
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTables at line 1132
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFrom at line 1059
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause at line 980
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens at line 928
Tag Value
Cockroach Release v22.1.13
Cockroach SHA: 8dfa17e
Platform linux amd64
Distribution CCL
Environment v22.1.13
Command demo
Go Version ``
# of CPUs
# of Goroutines

Jira issue: CRDB-23577

@cockroach-teamcity cockroach-teamcity added 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. labels Jan 19, 2023
@yuzefovich
Copy link
Member

dup of #95543

@exalate-issue-sync exalate-issue-sync bot changed the title sentry: catch.go:29: runtime error: invalid memory address or nil pointer dereference (1) assertion failure Wraps: (2) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/util/erro... sentry: catch.go:29: runtime error: invalid memory address or nil pointer dereference (1) assertion failure Wraps: (2) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/util/erro... Jan 20, 2023
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.
Projects
None yet
Development

No branches or pull requests

2 participants