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: nil pointer error in crdb_internal.create_join_token() #63819

Closed
cockroach-teamcity opened this issue Apr 17, 2021 · 7 comments
Closed

sql: nil pointer error in crdb_internal.create_join_token() #63819

cockroach-teamcity opened this issue Apr 17, 2021 · 7 comments
Labels
A-authentication Pertains to authn subsystems branch-master Failures and bugs on the master branch. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. exception-requested Issue is a release-blocker you want to defer by exception O-roachtest O-robot Originated from a bot. T-server-and-security DB Server & Security

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Apr 17, 2021

roachtest.sqlsmith/setup=seed/setting=no-mutations failed with artifacts on master @ 3aad3f8a372090ddaedad0ad58a945fb399ddbc6:

The test failed on branch=master, cloud=gce:
test artifacts and logs in: /home/agent/work/.go/src/github.com/cockroachdb/cockroach/artifacts/sqlsmith/setup=seed/setting=no-mutations/run_1
	sqlsmith.go:226,sqlsmith.go:262,test_runner.go:777: error: pq: internal error: unexpected error from the vectorized engine: runtime error: invalid memory address or nil pointer dereference
		stmt:
		SELECT
			'\x279c9d28f822':::BYTES AS col_7214,
			ltrim(tab_2951._string::STRING, substring(crdb_internal.create_join_token()::STRING::STRING, tab_2951._string::STRING)::STRING::STRING)::STRING
				AS col_7215,
			NULL AS col_7216,
			'54 years 10 mons 108 days 16:52:26.431107':::INTERVAL AS col_7217,
			(-1588361841):::INT8 AS col_7218,
			(-6600515062182289230):::INT8 AS col_7219,
			NULL AS col_7220,
			tab_2951._jsonb AS col_7221
		FROM
			defaultdb.public.seed@seed__int8__float8__date_idx AS tab_2951
		WHERE
			tab_2951._bool;
Reproduce

To reproduce, try:

# From https://go.crdb.dev/p/roachstress, perhaps edited lightly.
caffeinate ./roachstress.sh sqlsmith/setup=seed/setting=no-mutations

/cc @cockroachdb/sql-queries

This test on roachdash | Improve this report!

Jira issue: CRDB-6784

@cockroach-teamcity cockroach-teamcity added branch-master Failures and bugs on the master branch. C-test-failure Broken test (automatically or manually discovered). O-roachtest O-robot Originated from a bot. release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. labels Apr 17, 2021
@rytaft
Copy link
Collaborator

rytaft commented Apr 19, 2021

Here's a stack trace:

encountered internal error:
unexpected error from the vectorized engine: ‹runtime error: invalid memory address or nil pointer dereference›
(1) attached stack trace
  -- stack trace:
  | github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc.(*Inbox).Next.func1
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/inbox.go:271
  | runtime.gopanic
  | 	/usr/local/go/src/runtime/panic.go:969
  | github.com/cockroachdb/cockroach/pkg/sql/colexecerror.ExpectedError
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:200
  | github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc.(*Inbox).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/inbox.go:317
  | github.com/cockroachdb/cockroach/pkg/sql/colflow.(*batchInfoCollector).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/stats.go:86
  | github.com/cockroachdb/cockroach/pkg/sql/colexecop.(*noopOperator).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexecop/operator.go:305
  | github.com/cockroachdb/cockroach/pkg/sql/colflow.panicInjector.Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/panic_injector.go:63
  | github.com/cockroachdb/cockroach/pkg/sql/colflow.(*batchInfoCollector).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/stats.go:86
  | github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/materializer.go:290
  | github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).nextAdapter
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/materializer.go:315
  | github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:91
  | github.com/cockroachdb/cockroach/pkg/sql/colexec.(*Materializer).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/materializer.go:321
  | github.com/cockroachdb/cockroach/pkg/sql/execinfra.Run
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/execinfra/base.go:175
  | github.com/cockroachdb/cockroach/pkg/sql/execinfra.(*ProcessorBase).Run
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/execinfra/processorsbase.go:774
  | github.com/cockroachdb/cockroach/pkg/sql/flowinfra.(*FlowBase).Run
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/flowinfra/flow.go:382
  | github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).Run
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:359
  | github.com/cockroachdb/cockroach/pkg/sql.(*DistSQLPlanner).PlanAndRun
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:985
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithDistSQLEngine
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1048
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).dispatchToExecutionEngine
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:915
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmtInOpenState
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:659
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:122
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd.func1
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1527
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1529
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).run
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1450
  | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:484
  | github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).processCommandsAsync.func1
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:626
  | runtime.goexit
  | 	/usr/local/go/src/runtime/asm_amd64.s:1374
Wraps: (2)
Wraps: (3) tags: [n1,client=‹35.196.81.19:53184›,hostnossl,user=root,streamID=‹2›,received-error]
Wraps: (4) tags: [n‹3›,streamID=‹2›,sent-error=‹›]
Wraps: (5) assertion failure
Wraps: (6)
  | (opaque error wrapper)
  | type name: github.com/cockroachdb/errors/withstack/*withstack.withStack
  | reportable 0:
  |
  | github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError.func1
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:88
  | runtime.gopanic
  | 	/usr/local/go/src/runtime/panic.go:969
  | runtime.panicmem
  | 	/usr/local/go/src/runtime/panic.go:212
  | runtime.sigpanic
  | 	/usr/local/go/src/runtime/signal_unix.go:742
  | github.com/cockroachdb/cockroach/pkg/sql/sem/builtins.glob..func220
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:3895
  | github.com/cockroachdb/cockroach/pkg/sql/colexec.(*defaultBuiltinFuncOperator).Next.func1
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:83
  | github.com/cockroachdb/cockroach/pkg/sql/colmem.(*Allocator).PerformOperation
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colmem/allocator.go:300
  | github.com/cockroachdb/cockroach/pkg/sql/colexec.(*defaultBuiltinFuncOperator).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:61
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145
  | github.com/cockroachdb/cockroach/pkg/sql/colexec.(*defaultBuiltinFuncOperator).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:48
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145
  | github.com/cockroachdb/cockroach/pkg/sql/colexec.(*defaultBuiltinFuncOperator).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:48
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.constNullOp.Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:653
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.constIntervalOp.Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:547
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.constInt64Op.Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:403
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.constInt64Op.Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:403
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*vectorTypeEnforcer).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.constNullOp.Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:653
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase.(*simpleProjectOp).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/simple_project.go:124
  | github.com/cockroachdb/cockroach/pkg/sql/colflow.panicInjector.Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/panic_injector.go:63
  | github.com/cockroachdb/cockroach/pkg/sql/colflow.(*batchInfoCollector).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/stats.go:86
  | github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils.(*deselectorOp).Next
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/deselector.go:68
  | github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc.(*Outbox).sendBatches.func1
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:257
  | github.com/cockroachdb/cockroach/pkg/sql/colexecerror.CatchVectorizedRuntimeError
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:91
  | github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc.(*Outbox).sendBatches
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:249
  | github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc.(*Outbox).runWithStream
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:346
  | github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc.(*Outbox).Run
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:194
  | github.com/cockroachdb/cockroach/pkg/sql/colflow.(*vectorizedFlowCreator).setupRemoteOutputStream.func1
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/colflow/vectorized_flow.go:657

cc @yuzefovich any idea what might have happened here?

@rytaft
Copy link
Collaborator

rytaft commented Apr 19, 2021

Looks like the panic happened inside create_join_token(), which was added recently in #62053. cc @itsbilal in case you have ideas.

@rytaft
Copy link
Collaborator

rytaft commented Apr 19, 2021

I couldn't reproduce this locally, but here's everything from the test logs you should need to try...

CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
        SELECT
                g::INT2 AS _int2,
                g::INT4 AS _int4,
                g::INT8 AS _int8,
                g::FLOAT4 AS _float4,
                g::FLOAT8 AS _float8,
                '2001-01-01'::DATE + g AS _date,
                '2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
                '2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
                g * '1 day'::INTERVAL AS _interval,
                g % 2 = 1 AS _bool,
                g::DECIMAL AS _decimal,
                g::STRING AS _string,
                g::STRING::BYTES AS _bytes,
                substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
                '0.0.0.0'::INET + g AS _inet,
                g::STRING::JSONB AS _jsonb,
                enum_range('hello'::greeting)[g] as _enum
        FROM
                generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);

SELECT
        '\x279c9d28f822':::BYTES AS col_7214,
        ltrim(tab_2951._string::STRING, substring(crdb_internal.create_join_token()::STRING::STRING, tab_2951._string::STRING)::STRING::STRING)::STRING
                AS col_7215,
        NULL AS col_7216,
        '54 years 10 mons 108 days 16:52:26.431107':::INTERVAL AS col_7217,
        (-1588361841):::INT8 AS col_7218,
        (-6600515062182289230):::INT8 AS col_7219,
        NULL AS col_7220,
        tab_2951._jsonb AS col_7221
FROM
        seed@seed__int8__float8__date_idx AS tab_2951
WHERE
        tab_2951._bool;

@rytaft
Copy link
Collaborator

rytaft commented Apr 19, 2021

You might also need to run SET CLUSTER SETTING feature.tls_auto_join.enabled = true;, since otherwise you get the error ERROR: crdb_internal.create_join_token(): feature create join tokens was disabled by the database administrator. I didn't find that line anywhere in the sqlsmith log, though, so it's possible that the setting was disabled for the test.

@rytaft
Copy link
Collaborator

rytaft commented Apr 19, 2021

Hmm I was able to reproduce this once, but not deterministically. I tried with ./cockroach demo --geo-partitioned-replicas to get a multi-node cluster, and I got this error (which matches the stack trace):

ERROR: internal error: unexpected error from the vectorized engine: runtime error: invalid memory address or nil pointer dereference
SQLSTATE: XX000
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:88: func1()
runtime/panic.go:969: gopanic()
runtime/panic.go:212: panicmem()
runtime/signal_unix.go:742: sigpanic()
github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:3895: func220()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:83: func1()
github.com/cockroachdb/cockroach/pkg/sql/colmem/allocator.go:300: PerformOperation()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:61: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:48: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:48: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:653: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:547: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:403: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:403: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:653: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/simple_project.go:124: Next()
github.com/cockroachdb/cockroach/pkg/sql/colflow/stats.go:86: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/deselector.go:68: Next()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:257: func1()
github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:91: CatchVectorizedRuntimeError()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:249: sendBatches()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:346: runWithStream()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:194: Run()
github.com/cockroachdb/cockroach/pkg/sql/colflow/vectorized_flow.go:657: func1()
github.com/cockroachdb/cockroach/pkg/sql/colflow/vectorized_flow.go:1325: 1()

HINT: You have encountered an unexpected error.

Please check the public issue tracker to check whether this problem is
already tracked. If you cannot find it there, please report the error
with details by creating a new issue.

If you would rather not post publicly, please contact us directly
using the support form.

We appreciate your feedback.

Note that this error happened with cluster setting feature.tls_auto_join.enabled disabled. Here's the full terminal output:

Rebeccas-MacBook-Pro:cockroach becca$ ./cockroach demo --geo-partitioned-replicas
#
# --geo-partitioned replicas operates on a 9 node cluster.
# The cluster size has been changed from the default to 9 nodes.
#
# Welcome to the CockroachDB demo database!
#
# You are connected to a temporary, in-memory CockroachDB cluster of 9 nodes.
#
# This demo session will attempt to enable enterprise features
# by acquiring a temporary license from Cockroach Labs in the background.
# To disable this behavior, set the environment variable
# COCKROACH_SKIP_ENABLING_DIAGNOSTIC_REPORTING=true.
#
# Beginning initialization of the movr dataset, please wait...
#
# Waiting for license acquisition to complete...
#
# Partitioning the demo database, please wait...
#
# The cluster has been preloaded with the "movr" dataset
# (MovR is a fictional vehicle sharing company).
#
# Reminder: your changes to data stored in the demo session will not be saved!
#
# Connection parameters:
#   (webui)    http://127.0.0.1:8080/demologin?password=demo32622&username=demo
#   (sql)      postgres://demo:[email protected]:26257?sslmode=require
#   (sql/unix) postgres://demo:demo32622@?host=%2Fvar%2Ffolders%2Fwc%2Fhvy8pyy128z3v_f9lhvxw99h0000gn%2FT%2Fdemo132055797&port=26257
# 
# To display connection parameters for other nodes, use \demo ls.
#
# The user "demo" with password "demo32622" has been created. Use it to access the Web UI!
#
# Server version: CockroachDB CCL v21.1.0-alpha.3-2450-gdf253ab1e1-dirty (x86_64-apple-darwin20.3.0, built , go1.15.5) (same version as client)
# Cluster ID: 51ff8af2-0a5b-4fc6-925a-d7ce9ea01cbd
# Organization: Cockroach Demo
#
# Enter \? for a brief introduction.
#
[email protected]:26257/movr> CREATE TYPE greeting AS ENUM ('hello', 'howdy', 'hi', 'good day', 'morning');
CREATE TABLE IF NOT EXISTS seed AS
        SELECT
                g::INT2 AS _int2,
                g::INT4 AS _int4,
                g::INT8 AS _int8,
                g::FLOAT4 AS _float4,
                g::FLOAT8 AS _float8,
                '2001-01-01'::DATE + g AS _date,
                '2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
                '2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
                g * '1 day'::INTERVAL AS _interval,
                g % 2 = 1 AS _bool,
                g::DECIMAL AS _decimal,
                g::STRING AS _string,
                g::STRING::BYTES AS _bytes,
                substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
                '0.0.0.0'::INET + g AS _inet,
                g::STRING::JSONB AS _jsonb,
                enum_range('hello'::greeting)[g] as _enum
        FROM
                generate_series(1, 5) AS g;
INSERT INTO seed DEFAULT VALUES;
CREATE INDEX on seed (_int8, _float8, _date);
CREATE INVERTED INDEX on seed (_jsonb);

SELECT
        '\x279c9d28f822':::BYTES AS col_7214,
        ltrim(tab_2951._string::STRING, substring(crdb_internal.create_join_token()::STRING::STRING, tab_2951._string::STRING)::STRING::STRING)::STRING
                AS col_7215,
        NULL AS col_7216,
        '54 years 10 mons 108 days 16:52:26.431107':::INTERVAL AS col_7217,
        (-1588361841):::INT8 AS col_7218,
        (-6600515062182289230):::INT8 AS col_7219,
        NULL AS col_7220,
        tab_2951._jsonb AS col_7221
FROM
        seed@seed__int8__float8__date_idx AS tab_2951
WHERE
        tab_2951._bool;
CREATE TYPE

Time: 9ms total (execution 9ms / network 0ms)

CREATE TABLE AS

Time: 434ms total (execution 86ms / network 349ms)

INSERT 1

Time: 4.675s total (execution 4.675s / network 0.000s)

CREATE INDEX

Time: 314ms total (execution 21ms / network 293ms)

CREATE INDEX

Time: 298ms total (execution 24ms / network 274ms)

ERROR: crdb_internal.create_join_token(): feature create join tokens was disabled by the database administrator
SQLSTATE: 57000
[email protected]:26257/movr> CREATE TABLE IF NOT EXISTS seed AS
        SELECT
                g::INT2 AS _int2,
                g::INT4 AS _int4,
                g::INT8 AS _int8,
                g::FLOAT4 AS _float4,
                g::FLOAT8 AS _float8,
                '2001-01-01'::DATE + g AS _date,
                '2001-01-01'::TIMESTAMP + g * '1 day'::INTERVAL AS _timestamp,
                '2001-01-01'::TIMESTAMPTZ + g * '1 day'::INTERVAL AS _timestamptz,
                g * '1 day'::INTERVAL AS _interval,
                g % 2 = 1 AS _bool,
                g::DECIMAL AS _decimal,
                g::STRING AS _string,
                g::STRING::BYTES AS _bytes,
                substring('00000000-0000-0000-0000-' || g::STRING || '00000000000', 1, 36)::UUID AS _uuid,
                '0.0.0.0'::INET + g AS _inet,
                g::STRING::JSONB AS _jsonb,
                enum_range('hello'::greeting)[g] as _enum
        FROM
                generate_series(1, 5) AS g;
NOTICE: relation "seed" already exists, skipping
CREATE TABLE AS

Time: 4ms total (execution 4ms / network 0ms)

[email protected]:26257/movr> SELECT
        '\x279c9d28f822':::BYTES AS col_7214,
        ltrim(tab_2951._string::STRING, substring(crdb_internal.create_join_token()::STRING::STRING, tab_2951._string::STRING)::STRING::STRING)::STRING
                AS col_7215,
        NULL AS col_7216,
        '54 years 10 mons 108 days 16:52:26.431107':::INTERVAL AS col_7217,
        (-1588361841):::INT8 AS col_7218,
        (-6600515062182289230):::INT8 AS col_7219,
        NULL AS col_7220,
        tab_2951._jsonb AS col_7221
FROM
        seed@seed__int8__float8__date_idx AS tab_2951
WHERE
        tab_2951._bool;
ERROR: internal error: unexpected error from the vectorized engine: runtime error: invalid memory address or nil pointer dereference
SQLSTATE: XX000
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:88: func1()
runtime/panic.go:969: gopanic()
runtime/panic.go:212: panicmem()
runtime/signal_unix.go:742: sigpanic()
github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:3895: func220()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:83: func1()
github.com/cockroachdb/cockroach/pkg/sql/colmem/allocator.go:300: PerformOperation()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:61: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:48: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:48: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:653: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:547: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:403: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:403: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:653: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/simple_project.go:124: Next()
github.com/cockroachdb/cockroach/pkg/sql/colflow/stats.go:86: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/deselector.go:68: Next()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:257: func1()
github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:91: CatchVectorizedRuntimeError()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:249: sendBatches()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:346: runWithStream()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:194: Run()
github.com/cockroachdb/cockroach/pkg/sql/colflow/vectorized_flow.go:657: func1()
github.com/cockroachdb/cockroach/pkg/sql/colflow/vectorized_flow.go:1325: 1()

HINT: You have encountered an unexpected error.

Please check the public issue tracker to check whether this problem is
already tracked. If you cannot find it there, please report the error
with details by creating a new issue.

If you would rather not post publicly, please contact us directly
using the support form.

We appreciate your feedback.
[email protected]:26257/movr> SELECT
        '\x279c9d28f822':::BYTES AS col_7214,
        ltrim(tab_2951._string::STRING, substring(crdb_internal.create_join_token()::STRING::STRING, tab_2951._string::STRING)::STRING::STRING)::STRING
                AS col_7215,
        NULL AS col_7216,
        '54 years 10 mons 108 days 16:52:26.431107':::INTERVAL AS col_7217,
        (-1588361841):::INT8 AS col_7218,
        (-6600515062182289230):::INT8 AS col_7219,
        NULL AS col_7220,
        tab_2951._jsonb AS col_7221
FROM
        seed@seed__int8__float8__date_idx AS tab_2951
WHERE
        tab_2951._bool;
ERROR: internal error: unexpected error from the vectorized engine: runtime error: invalid memory address or nil pointer dereference
SQLSTATE: XX000
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:88: func1()
runtime/panic.go:969: gopanic()
runtime/panic.go:212: panicmem()
runtime/signal_unix.go:742: sigpanic()
github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtins.go:3895: func220()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:83: func1()
github.com/cockroachdb/cockroach/pkg/sql/colmem/allocator.go:300: PerformOperation()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:61: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:48: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/builtin_funcs.go:48: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:653: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:547: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:403: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:403: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/operator.go:145: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/const.eg.go:653: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase/simple_project.go:124: Next()
github.com/cockroachdb/cockroach/pkg/sql/colflow/stats.go:86: Next()
github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils/deselector.go:68: Next()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:257: func1()
github.com/cockroachdb/cockroach/pkg/sql/colexecerror/error.go:91: CatchVectorizedRuntimeError()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:249: sendBatches()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:346: runWithStream()
github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc/outbox.go:194: Run()
github.com/cockroachdb/cockroach/pkg/sql/colflow/vectorized_flow.go:657: func1()
github.com/cockroachdb/cockroach/pkg/sql/colflow/vectorized_flow.go:1325: 1()

HINT: You have encountered an unexpected error.

Please check the public issue tracker to check whether this problem is
already tracked. If you cannot find it there, please report the error
with details by creating a new issue.

If you would rather not post publicly, please contact us directly
using the support form.

We appreciate your feedback.

@rytaft rytaft added branch-release-21.1 GA-blocker and removed release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. GA-blocker branch-release-21.1 labels Apr 19, 2021
@rytaft
Copy link
Collaborator

rytaft commented Apr 19, 2021

I think I've hit the limit of my ability to help here, so I'll let others chime in. In the mean time, I am removing the release blocker label since crdb_internal.create_join_token() does not exist in release-21.1.

@rytaft rytaft changed the title roachtest: sqlsmith/setup=seed/setting=no-mutations failed sql: nil pointer error in crdb_internal.create_join_token() Apr 19, 2021
craig bot pushed a commit that referenced this issue Apr 19, 2021
63852: server: skip TestTelemetrySQLStatsIndependence r=tbg a=knz

This test flakes if the reg server is temporarily unavailable.

Informs  #63844, #63851,  #63848

63854: sqlsmith: don't use crdb_internal.create_join_token r=yuzefovich a=yuzefovich

This is an internal builtin, and we probably don't get much when using
it in the sqlsmith. Currently this builtin occasionally leads to an
internal error.

Addresses: #63819.

Release note: None

Co-authored-by: Raphael 'kena' Poss <[email protected]>
Co-authored-by: Yahor Yuzefovich <[email protected]>
@jlinder jlinder added the T-server-and-security DB Server & Security label Jun 16, 2021
@knz knz added the A-authentication Pertains to authn subsystems label Jul 29, 2021
@williamkulju williamkulju added the exception-requested Issue is a release-blocker you want to defer by exception label Jul 12, 2023
@exalate-issue-sync exalate-issue-sync bot assigned knz and unassigned itsbilal Aug 18, 2023
@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. and removed C-test-failure Broken test (automatically or manually discovered). labels Sep 13, 2023
@celiala celiala unassigned knz Nov 17, 2023
@rafiss
Copy link
Collaborator

rafiss commented Jan 9, 2024

Closing due to staleness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-authentication Pertains to authn subsystems branch-master Failures and bugs on the master branch. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. exception-requested Issue is a release-blocker you want to defer by exception O-roachtest O-robot Originated from a bot. T-server-and-security DB Server & Security
Projects
No open projects
Status: Done 21.2
Development

No branches or pull requests

7 participants