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

sql: v20.2.2: nil pointer when accessing descriptor during optbuild #57779

Closed
cockroach-teamcity opened this issue Dec 10, 2020 · 1 comment
Closed
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

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/2083227683/?referrer=webhooks_plugin

Panic message:

*barriers.barrierError
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
/usr/local/go/src/runtime/panic.go#L678-L680 in runtime.gopanic
/usr/local/go/src/runtime/panic.go#L198-L200 in runtime.panicmem
/usr/local/go/src/runtime/signal_unix.go#L393-L395 in runtime.sigpanic
switch {
case desc.Dropped() && !flags.IncludeDropped:
return NewInactiveDescriptorError(ErrDescriptorDropped)
in pkg/sql/catalog.FilterDescriptorState
// OFFLINE if the relevant flag is set.
if err := catalog.FilterDescriptorState(desc, flags.CommonLookupFlags); err != nil {
if flags.Required {
in pkg/sql/catalog/catalogkv.UncachedPhysicalAccessor.GetObjectDesc
phyAccessor := catalogkv.UncachedPhysicalAccessor{}
return phyAccessor.GetObjectDesc(
ctx,
in pkg/sql/catalog/descs.(*Collection).getObjectVersion.func1
if shouldReadFromStore {
return readObjectFromStore()
}
in pkg/sql/catalog/descs.(*Collection).getObjectVersion
) (*tabledesc.Immutable, error) {
desc, err := tc.getObjectVersion(ctx, txn, tn, flags)
if err != nil {
in pkg/sql/catalog/descs.(*Collection).GetTableVersion
}
table, err := a.tc.GetTableVersion(ctx, txn, &a.tableName, flags)
if table == nil {
in pkg/sql/catalog/accessors.(*CachedPhysicalAccessor).GetObjectDesc
// Fallthrough.
return l.Accessor.GetObjectDesc(ctx, txn, settings, codec, db, schema, object, flags)
}
in pkg/sql/catalog/accessors.(*LogicalSchemaAccessor).GetObjectDesc
lookupFlags.CommonLookupFlags.AvoidCached = p.avoidCachedDescriptors
objDesc, err := sc.GetObjectDesc(ctx, p.txn, p.ExecCfg().Settings, p.ExecCfg().Codec, dbName, scName, tbName, lookupFlags)
in pkg/sql.(*planner).LookupObject
namePrefix.SchemaName = Name(scName)
found, result, err := r.LookupObject(ctx, lookupFlags, u.Catalog(), scName, u.Object())
return found, namePrefix, result, err
in pkg/sql/sem/tree.ResolveExisting
) (res tree.NameResolutionResult, prefix tree.ObjectNamePrefix, err error) {
found, prefix, descI, err := tree.ResolveExisting(ctx, un, sc, lookupFlags, sc.CurrentDatabase(), sc.CurrentSearchPath())
if err != nil {
in pkg/sql/catalog/resolver.ResolveExistingObject
un := tn.ToUnresolvedObjectName()
desc, prefix, err := ResolveExistingObject(ctx, sc, un, lookupFlags)
if err != nil || desc == nil {
in pkg/sql/catalog/resolver.ResolveExistingTableObject
lflags := tree.ObjectLookupFlagsWithRequiredTableKind(tree.ResolveAnyTableKind)
desc, err := resolver.ResolveExistingTableObject(ctx, oc.planner, &oc.tn, lflags)
if err != nil {
in pkg/sql.(*optCatalog).ResolveDataSource
}
ds, resName, err := b.catalog.ResolveDataSource(b.ctx, flags, tn)
if err != nil {
in pkg/sql/opt/optbuilder.(*Builder).resolveDataSource
ds, resName := b.resolveDataSource(tn, priv)
switch t := ds.(type) {
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
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)
inScope.atRoot = prevAtRoot
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
return b.buildStmt(stmt, desiredTypes, inScope)
}
in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot
// and physical properties.
outScope := b.buildStmtAtRoot(b.stmt, nil /* desiredTypes */, b.allocScope())
in pkg/sql/opt/optbuilder.(*Builder).Build
bld := optbuilder.New(ctx, &p.semaCtx, p.EvalContext(), &opc.catalog, f, opc.p.stmt.AST)
if err := bld.Build(); err != nil {
return nil, err
in pkg/sql.(*optPlanningCtx).buildExecMemo

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 165
/usr/local/go/src/runtime/panic.go in runtime.gopanic at line 679
/usr/local/go/src/runtime/panic.go in runtime.panicmem at line 199
/usr/local/go/src/runtime/signal_unix.go in runtime.sigpanic at line 394
pkg/sql/catalog/descriptor.go in pkg/sql/catalog.FilterDescriptorState at line 202
pkg/sql/catalog/catalogkv/physical_accessor.go in pkg/sql/catalog/catalogkv.UncachedPhysicalAccessor.GetObjectDesc at line 320
pkg/sql/catalog/descs/collection.go in pkg/sql/catalog/descs.(*Collection).getObjectVersion.func1 at line 783
pkg/sql/catalog/descs/collection.go in pkg/sql/catalog/descs.(*Collection).getObjectVersion at line 860
pkg/sql/catalog/descs/collection.go in pkg/sql/catalog/descs.(*Collection).GetTableVersion at line 760
pkg/sql/catalog/accessors/physical_schema_accessors.go in pkg/sql/catalog/accessors.(*CachedPhysicalAccessor).GetObjectDesc at line 132
pkg/sql/catalog/accessors/logical_schema_accessors.go in pkg/sql/catalog/accessors.(*LogicalSchemaAccessor).GetObjectDesc at line 136
pkg/sql/resolver.go in pkg/sql.(*planner).LookupObject at line 209
pkg/sql/sem/tree/name_resolution.go in pkg/sql/sem/tree.ResolveExisting at line 302
pkg/sql/catalog/resolver/resolver.go in pkg/sql/catalog/resolver.ResolveExistingObject at line 153
pkg/sql/catalog/resolver/resolver.go in pkg/sql/catalog/resolver.ResolveExistingTableObject at line 90
pkg/sql/opt_catalog.go in pkg/sql.(*optCatalog).ResolveDataSource at line 207
pkg/sql/opt/optbuilder/util.go in pkg/sql/opt/optbuilder.(*Builder).resolveDataSource at line 586
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 110
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 59
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep at line 1219
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTables at line 1196
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFrom at line 1123
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause at line 1044
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens at line 992
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1 at line 965
pkg/sql/opt/optbuilder/with.go in pkg/sql/opt/optbuilder.(*Builder).processWiths at line 29
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect at line 964
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 265
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot at line 229
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).Build at line 200
pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).buildExecMemo at line 512
Tag Value
Cockroach Release v20.2.2
Cockroach SHA: 92d9495
Platform linux amd64
Distribution CCL
Environment v20.2.2
Command server
Go Version ``
# of CPUs
# of Goroutines
@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 Dec 10, 2020
@yuzefovich yuzefovich changed the title sentry: *barriers.barrierError catch.go:29: *withstack.withStack (top exception) *assert.withAssertionFailure sql: v20.2.2: nil pointer when accessing descriptor during optbuild Dec 11, 2020
@jordanlewis
Copy link
Member

Closing as duplicate of #57639.

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