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: conn_executor.go:830: runtime error: index out of range [0] with length 0 (1) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1 | github.... #95008

Closed
cockroach-teamcity opened this issue Jan 10, 2023 · 0 comments · Fixed by #95009
Assignees
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 10, 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/3866472325/?referrer=webhooks_plugin

Panic message:

conn_executor.go:830: runtime error: index out of range [0] with length 0
(1) attached stack trace
-- stack trace:
| github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:830
| [...repeated from below...]
Wraps: (2) while executing: SELECT z()
Wraps: (3) attached stack trace
-- stack trace:
| github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:830
| runtime.gopanic
| GOROOT/src/runtime/panic.go:884
| runtime.goPanicIndex
| GOROOT/src/runtime/panic.go:113
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*DTuple).pgwireFormat
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree/pgwire_encode.go:52
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*DTuple).Format
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree/datum.go:4040
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*FmtCtx).formatNodeOrHideConstants
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree/hide_constants.go:49
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree.(*FmtCtx).FormatNode
| github.com/cockroachdb/cockroach/pkg/sql/sem/tree/format.go:452
| github.com/cockroachdb/cockroach/pkg/sql/pgwire.writeTextDatumNotNull
| github.com/cockroachdb/cockroach/pkg/sql/pgwire/types.go:244
| github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*writeBuffer).writeTextColumnarElement
| github.com/cockroachdb/cockroach/pkg/sql/pgwire/types.go:352
| github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).bufferBatch
| github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:1391
| github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*commandResult).AddBatch
| github.com/cockroachdb/cockroach/pkg/sql/pgwire/command_result.go:230
| github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLReceiver).PushBatch
| github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:1369
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*BatchFlowCoordinator).Run
| github.com/cockroachdb/cockroach/pkg/sql/colflow/flow_coordinator.go:311
| github.com/cockroachdb/cockroach/pkg/sql/colflow.(*vectorizedFlow).Run
| github.com/cockroachdb/cockroach/pkg/sql/colflow/vectorized_flow.go:320
| github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).Run
| github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:731
| github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).PlanAndRun
| github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:1698
| github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).PlanAndRunAll
| github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:1421
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithDistSQLEngine
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1579
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).dispatchToExecutionEngine
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1193
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmtInOpenState
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:689
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt.func1
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:131
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithProfiling
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:2420
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:130
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd.func1
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1932
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1936
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).run
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1858
| github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:832
| github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).processCommandsAsync.func1
| github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:728
| runtime.goexit
| src/runtime/asm_amd64.s:1594
Wraps: (4) runtime error: index out of range [0] with length 0
Error types: (1) *withstack.withStack (2) *safedetails.withSafeDetails (3) *withstack.withStack (4) runtime.boundsError
-- report composition:
runtime.boundsError
conn_executor.go:830: *withstack.withStack (top exception)
*safedetails.withSafeDetails: while executing: SELECT z(
)
conn_executor.go:830: *withstack.withStack (1)
(check the extra data payloads)

Stacktrace (expand for inline code snippets):

r := recover()
h.ex.closeWrapper(ctx, r)
}(ctx, h)
in pkg/sql.(*Server).ServeConn.func1
GOROOT/src/runtime/panic.go#L883-L885 in runtime.gopanic
GOROOT/src/runtime/panic.go#L112-L114 in runtime.goPanicIndex
ctx.WriteString(comma)
t := d.ResolvedType().TupleContents()[i]
switch dv := UnwrapDOidWrapper(v).(type) {
in pkg/sql/sem/tree.(*DTuple).pgwireFormat
if ctx.HasFlags(fmtPgwireFormat) {
d.pgwireFormat(ctx)
return
in pkg/sql/sem/tree.(*DTuple).Format
}
n.Format(ctx)
}
in pkg/sql/sem/tree.(*FmtCtx).formatNodeOrHideConstants
} else {
ctx.formatNodeOrHideConstants(n)
}
in pkg/sql/sem/tree.(*FmtCtx).FormatNode
case *tree.DTuple:
b.textFormatter.FormatNode(v)
b.writeFromFmtCtx(b.textFormatter)
in pkg/sql/pgwire.writeTextDatumNotNull
// All other types are represented via the datum-backed vector.
writeTextDatumNotNull(b, vecs.DatumCols[colIdx].Get(rowIdx).(tree.Datum), conv, sessionLoc, typ)
}
in pkg/sql/pgwire.(*writeBuffer).writeTextColumnarElement
case pgwirebase.FormatText:
c.msgBuilder.writeTextColumnarElement(ctx, &c.vecsScratch, vecIdx, rowIdx, r.conv, r.location)
case pgwirebase.FormatBinary:
in pkg/sql/pgwire.(*conn).bufferBatch
r.rowsAffected += batch.Length()
return r.conn.bufferBatch(ctx, batch, r)
}
in pkg/sql/pgwire.(*commandResult).AddBatch
r.tracing.TraceExecBatchResult(r.ctx, batch)
if commErr := r.batchWriter.AddBatch(r.ctx, batch); commErr != nil {
r.handleCommErr(commErr)
in pkg/sql.(*DistSQLReceiver).PushBatch
}
switch status = f.output.PushBatch(f.batch, nil /* meta */); status {
case execinfra.ConsumerClosed:
in pkg/sql/colflow.(*BatchFlowCoordinator).Run
log.VEvent(ctx, 1, "running the batch flow coordinator in the flow's goroutine")
f.batchFlowCoordinator.Run(ctx)
}
in pkg/sql/colflow.(*vectorizedFlow).Run
// TODO(radu): this should go through the flow scheduler.
flow.Run(ctx, func() {})
in pkg/sql.(*DistSQLPlanner).Run
recv.expectedRowsRead = int64(physPlan.TotalEstimatedScannedRows)
runCleanup := dsp.Run(ctx, planCtx, txn, physPlan, recv, evalCtx, nil /* finishedSetupFn */)
return func() {
in pkg/sql.(*DistSQLPlanner).PlanAndRun
// the planner whether or not to plan remote table readers.
cleanup := dsp.PlanAndRun(
ctx, evalCtx, planCtx, planner.txn, planner.curPlan.main, recv,
in pkg/sql.(*DistSQLPlanner).PlanAndRunAll
}
err := ex.server.cfg.DistSQLPlanner.PlanAndRunAll(ctx, evalCtx, planCtx, planner, recv, evalCtxFactory)
return *recv.stats, err
in pkg/sql.(*connExecutor).execWithDistSQLEngine
ex.sessionTracing.TraceExecStart(ctx, "distributed")
stats, err = ex.execWithDistSQLEngine(
ctx, planner, stmt.AST.StatementReturnType(), res, distribute, progAtomic,
in pkg/sql.(*connExecutor).dispatchToExecutionEngine
if err := ex.dispatchToExecutionEngine(stmtCtx, p, res); err != nil {
stmtThresholdSpan.Finish()
in pkg/sql.(*connExecutor).execStmtInOpenState
err = ex.execWithProfiling(ctx, ast, prepared, func(ctx context.Context) error {
ev, payload, err = ex.execStmtInOpenState(ctx, parserStmt, prepared, pinfo, res, canAutoCommit)
return err
in pkg/sql.(*connExecutor).execStmt.func1
} else {
err = op(ctx)
}
in pkg/sql.(*connExecutor).execWithProfiling
case stateOpen:
err = ex.execWithProfiling(ctx, ast, prepared, func(ctx context.Context) error {
ev, payload, err = ex.execStmtInOpenState(ctx, parserStmt, prepared, pinfo, res, canAutoCommit)
in pkg/sql.(*connExecutor).execStmt
canAutoCommit := ex.implicitTxn() && (tcmd.LastInBatch || !implicitTxnForBatch)
ev, payload, err = ex.execStmt(
ctx, tcmd.Statement, nil /* prepared */, nil /* pinfo */, stmtRes, canAutoCommit,
in pkg/sql.(*connExecutor).execCmd.func1
return err
}()
// Note: we write to ex.statsCollector.PhaseTimes, instead of ex.phaseTimes,
in pkg/sql.(*connExecutor).execCmd
var err error
if err = ex.execCmd(); err != nil {
if errors.IsAny(err, io.EOF, errDrainingComplete) {
in pkg/sql.(*connExecutor).run
}(ctx, h)
return h.ex.run(ctx, s.pool, reserved, cancel)
}
in pkg/sql.(*Server).ServeConn
reservedOwned = false // We're about to pass ownership away.
retErr = sqlServer.ServeConn(ctx, connHandler, reserved, cancelConn)
}()
in pkg/sql/pgwire.(*conn).processCommandsAsync.func1
src/runtime/asm_amd64.s#L1593-L1595 in runtime.goexit

pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn.func1 at line 830
GOROOT/src/runtime/panic.go in runtime.gopanic at line 884
GOROOT/src/runtime/panic.go in runtime.goPanicIndex at line 113
pkg/sql/sem/tree/pgwire_encode.go in pkg/sql/sem/tree.(*DTuple).pgwireFormat at line 52
pkg/sql/sem/tree/datum.go in pkg/sql/sem/tree.(*DTuple).Format at line 4040
pkg/sql/sem/tree/hide_constants.go in pkg/sql/sem/tree.(*FmtCtx).formatNodeOrHideConstants at line 49
pkg/sql/sem/tree/format.go in pkg/sql/sem/tree.(*FmtCtx).FormatNode at line 452
pkg/sql/pgwire/types.go in pkg/sql/pgwire.writeTextDatumNotNull at line 244
pkg/sql/pgwire/types.go in pkg/sql/pgwire.(*writeBuffer).writeTextColumnarElement at line 352
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).bufferBatch at line 1391
pkg/sql/pgwire/command_result.go in pkg/sql/pgwire.(*commandResult).AddBatch at line 230
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLReceiver).PushBatch at line 1369
pkg/sql/colflow/flow_coordinator.go in pkg/sql/colflow.(*BatchFlowCoordinator).Run at line 311
pkg/sql/colflow/vectorized_flow.go in pkg/sql/colflow.(*vectorizedFlow).Run at line 320
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLPlanner).Run at line 731
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLPlanner).PlanAndRun at line 1698
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLPlanner).PlanAndRunAll at line 1421
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execWithDistSQLEngine at line 1579
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).dispatchToExecutionEngine at line 1193
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 689
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt.func1 at line 131
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execWithProfiling at line 2420
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 130
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd.func1 at line 1932
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd at line 1936
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 1858
pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn at line 832
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).processCommandsAsync.func1 at line 728
src/runtime/asm_amd64.s in runtime.goexit at line 1594
Tag Value
Cockroach Release v22.2.2
Cockroach SHA: 07a53a3
Platform darwin amd64
Distribution CCL
Environment v22.2.2
Command start-single-node
Go Version ``
# of CPUs
# of Goroutines

Jira issue: CRDB-23270

@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 10, 2023
@rafiss rafiss self-assigned this Jan 10, 2023
@craig craig bot closed this as completed in 6fd5b04 Jan 17, 2023
@exalate-issue-sync exalate-issue-sync bot changed the title sentry: conn_executor.go:830: runtime error: index out of range [0] with length 0 (1) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1 | github.... sentry: conn_executor.go:830: runtime error: index out of range [0] with length 0 (1) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1 | github.... Jan 17, 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

Successfully merging a pull request may close this issue.

2 participants