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

v22.1.0: sql: nil pointer with SET TRANSACTION AOST prepared statement #82035

Closed
cockroach-teamcity opened this issue May 29, 2022 · 0 comments · Fixed by #82641
Closed

v22.1.0: sql: nil pointer with SET TRANSACTION AOST prepared statement #82035

cockroach-teamcity opened this issue May 29, 2022 · 0 comments · Fixed by #82641
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. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented May 29, 2022

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

Panic message:

conn_executor.go:745: runtime error: invalid memory address or nil pointer dereference
(1) attached stack trace
-- stack trace:
| github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:745
| [...repeated from below...]
Wraps: (2) while executing: SET TRANSACTION AS OF SYSTEM TIME $1
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:745
| 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/types.(*T).Oid
| github.com/cockroachdb/cockroach/pkg/sql/types/pkg/sql/types/types.go:1169
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).addPreparedStmt
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_prepare.go:126
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execPrepare
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor_prepare.go:63
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1975
| github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).run
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1799
| github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn
| github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:747
| github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).processCommandsAsync.func1
| github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:724
| runtime.goexit
| GOROOT/src/runtime/asm_amd64.s:1581
Wraps: (4) runtime error: invalid memory address or nil pointer dereference
Error types: (1) *withstack.withStack (2) *safedetails.withSafeDetails (3) *withstack.withStack (4) runtime.errorString
-- report composition:
runtime.errorString
conn_executor.go:745: *withstack.withStack (top exception)
*safedetails.withSafeDetails: while executing: SET TRANSACTION AS OF SYSTEM TIME $1
conn_executor.go:745: *withstack.withStack (1)
(check the extra data payloads)

Stacktrace (expand for inline code snippets):

r := recover()
h.ex.closeWrapper(ctx, r)
}()
in pkg/sql.(*Server).ServeConn.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
https://github.com/cockroachdb/cockroach/blob/5b78463ed2e7106a8477b63fa837564ad02bb510/pkg/sql/types/pkg/sql/types/types.go#L1168-L1170 in pkg/sql/types.(*T).Oid
t, _ := prepared.ValueType(tree.PlaceholderIdx(i))
prepared.InferredTypes[i] = t.Oid()
}
in pkg/sql.(*connExecutor).addPreparedStmt
stmt := makeStatement(parseCmd.Statement, ex.generateID())
_, err := ex.addPreparedStmt(
ctx,
in pkg/sql.(*connExecutor).execPrepare
stmtCtx := withStatement(ctx, ex.curStmtAST)
ev, payload = ex.execPrepare(stmtCtx, tcmd)
case DescribeStmt:
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
}()
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
GOROOT/src/runtime/asm_amd64.s#L1580-L1582 in runtime.goexit

pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn.func1 at line 745
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/types/pkg/sql/types/types.go in pkg/sql/types.(*T).Oid at line 1169
pkg/sql/conn_executor_prepare.go in pkg/sql.(*connExecutor).addPreparedStmt at line 126
pkg/sql/conn_executor_prepare.go in pkg/sql.(*connExecutor).execPrepare at line 63
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd at line 1975
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 1799
pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn at line 747
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).processCommandsAsync.func1 at line 724
GOROOT/src/runtime/asm_amd64.s in runtime.goexit at line 1581
Tag Value
Cockroach Release v22.1.0
Cockroach SHA: 5b78463
Platform linux amd64
Distribution CCL
Environment v22.1.0
Command start-single-node
Go Version ``
# of CPUs
# of Goroutines

Jira issue: CRDB-16178
Epic CRDB-14049

@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 May 29, 2022
@rafiss rafiss changed the title sentry: conn_executor.go:745: runtime error: invalid memory address or nil pointer dereference (1) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn.func1... v22.1.0: sql: nil pointer with SET TRANSACTION AOST prepared statement May 29, 2022
@blathers-crl blathers-crl bot added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label May 29, 2022
@rafiss rafiss self-assigned this Jun 8, 2022
@craig craig bot closed this as completed in 7cfffc8 Jun 9, 2022
@craig craig bot closed this as completed in #82641 Jun 9, 2022
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. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants