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... #95540

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/3885483531/?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:192
| runtime.gopanic
| GOROOT/src/runtime/panic.go:838
| runtime.panicmem
| GOROOT/src/runtime/panic.go:220
| runtime.sigpanic
| GOROOT/src/runtime/signal_unix.go:818
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree.FormatBitArrayToType
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree/parse_string.go:121
| github.com/cockroachdb/cockroach/pkg/sql/sem/eval.performCastWithoutPrecisionTruncation
| github.com/cockroachdb/cockroach/pkg/sql/sem/eval/cast.go:147
| github.com/cockroachdb/cockroach/pkg/sql/sem/eval.PerformCast
| github.com/cockroachdb/cockroach/pkg/sql/sem/eval/cast.go:63
| github.com/cockroachdb/cockroach/pkg/sql/sem/builtins.glob..func233.1
| github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:4983
| github.com/cockroachdb/cockroach/pkg/sql/evalcatalog.(*Builtins).EncodeTableIndexKey
| github.com/cockroachdb/cockroach/pkg/sql/evalcatalog/encode_table_index_key.go:116
| github.com/cockroachdb/cockroach/pkg/sql/sem/builtins.glob..func233
| github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:4978
| github.com/cockroachdb/cockroach/pkg/sql/sem/eval.(*evaluator).EvalFuncExpr
| github.com/cockroachdb/cockroach/pkg/sql/sem/eval/expr.go:459
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*FuncExpr).Eval
| github.com/cockroachdb/cockroach/bazel-out/k8-opt/bin/pkg/sql/sem/tree/eval_expr_generated.go:264
| github.com/cockroachdb/cockroach/pkg/sql/sem/eval.Expr
| github.com/cockroachdb/cockroach/pkg/sql/sem/eval/expr.go:24
| github.com/cockroachdb/cockroach/pkg/sql/opt/norm.(*CustomFuncs).FoldFunction
| github.com/cockroachdb/cockroach/pkg/sql/opt/norm/fold_constants_funcs.go:618
| 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:19905
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildFunction
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:556
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildScalar
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:331
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildScalar
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:319
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildScalar
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scalar.go:124
| 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:1141
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectClause
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1023
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:968
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:937
| 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:936
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmt
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:302
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmt
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:397
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildDataSource
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:166
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildDataSource
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:62
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep
| github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1195
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#L837-L839 in runtime.gopanic
GOROOT/src/runtime/panic.go#L219-L221 in runtime.panicmem
GOROOT/src/runtime/signal_unix.go#L817-L819 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 = tree.FormatBitArrayToType(ba, t)
}
in pkg/sql/sem/eval.performCastWithoutPrecisionTruncation
func PerformCast(ctx *Context, d tree.Datum, t *types.T) (tree.Datum, error) {
ret, err := performCastWithoutPrecisionTruncation(ctx, d, t, true /* truncateWidth */)
if err != nil {
in pkg/sql/sem/eval.PerformCast
) (tree.Datum, error) {
return eval.PerformCast(ctx, d, t)
},
in pkg/sql/sem/builtins.glob..func233.1
expectedTyp := col.GetType()
newDatum, err = performCast(ctx, d, expectedTyp)
if err != nil {
in pkg/sql/evalcatalog.(*Builtins).EncodeTableIndexKey
}
res, err := ctx.CatalogBuiltins.EncodeTableIndexKey(
ctx.Ctx(), tableID, indexID, rowDatums,
in pkg/sql/sem/builtins.glob..func233
res, err := fn.Fn.(FnOverload)(e.ctx(), args)
if err != nil {
in pkg/sql/sem/eval.(*evaluator).EvalFuncExpr
https://github.com/cockroachdb/cockroach/blob/3688055c09cd32f1186624a1ccc3fe35e5a0cffd/bazel-out/k8-opt/bin/pkg/sql/sem/tree/eval_expr_generated.go#L263-L265 in pkg/sql/sem/tree.(*FuncExpr).Eval
func Expr(ctx *Context, n tree.TypedExpr) (tree.Datum, error) {
return n.Eval((*evaluator)(ctx))
}
in pkg/sql/sem/eval.Expr
result, err := eval.Expr(c.f.evalCtx, fn)
if err != nil {
in pkg/sql/opt/norm.(*CustomFuncs).FoldFunction
https://github.com/cockroachdb/cockroach/blob/3688055c09cd32f1186624a1ccc3fe35e5a0cffd/bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go#L19904-L19906 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

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 192
GOROOT/src/runtime/panic.go in runtime.gopanic at line 838
GOROOT/src/runtime/panic.go in runtime.panicmem at line 220
GOROOT/src/runtime/signal_unix.go in runtime.sigpanic at line 818
pkg/sql/sem/tree/parse_string.go in pkg/sql/sem/tree.FormatBitArrayToType at line 121
pkg/sql/sem/eval/cast.go in pkg/sql/sem/eval.performCastWithoutPrecisionTruncation at line 147
pkg/sql/sem/eval/cast.go in pkg/sql/sem/eval.PerformCast at line 63
pkg/sql/sem/builtins/builtins.go in pkg/sql/sem/builtins.glob..func233.1 at line 4983
pkg/sql/evalcatalog/encode_table_index_key.go in pkg/sql/evalcatalog.(*Builtins).EncodeTableIndexKey at line 116
pkg/sql/sem/builtins/builtins.go in pkg/sql/sem/builtins.glob..func233 at line 4978
pkg/sql/sem/eval/expr.go in pkg/sql/sem/eval.(*evaluator).EvalFuncExpr at line 459
bazel-out/k8-opt/bin/pkg/sql/sem/tree/eval_expr_generated.go in pkg/sql/sem/tree.(*FuncExpr).Eval at line 264
pkg/sql/sem/eval/expr.go in pkg/sql/sem/eval.Expr at line 24
pkg/sql/opt/norm/fold_constants_funcs.go in pkg/sql/opt/norm.(*CustomFuncs).FoldFunction at line 618
bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go in pkg/sql/opt/norm.(*Factory).ConstructFunction at line 19905
pkg/sql/opt/optbuilder/scalar.go in pkg/sql/opt/optbuilder.(*Builder).buildFunction at line 556
pkg/sql/opt/optbuilder/scalar.go in pkg/sql/opt/optbuilder.(*Builder).buildScalar at line 331
pkg/sql/opt/optbuilder/scalar.go in pkg/sql/opt/optbuilder.(*Builder).buildScalar at line 319
pkg/sql/opt/optbuilder/scalar.go in pkg/sql/opt/optbuilder.(*Builder).buildScalar at line 124
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 1141
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause at line 1023
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens at line 968
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1 at line 937
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 936
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 302
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 397
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 166
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 62
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep at line 1195
Tag Value
Cockroach Release v22.2.0-alpha.1
Cockroach SHA: 3688055
Platform linux amd64
Distribution CCL
Environment v22.2.0-alpha.1
Command demo
Go Version ``
# of CPUs
# of Goroutines

Jira issue: CRDB-23578

@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