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

opt: panic in replaceSQLFn #51472

Closed
rohany opened this issue Jul 15, 2020 · 2 comments
Closed

opt: panic in replaceSQLFn #51472

rohany opened this issue Jul 15, 2020 · 2 comments
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@rohany
Copy link
Contributor

rohany commented Jul 15, 2020

Found by RSG:

interface conversion: tree.TypedExpr is tree.dNull, not *tree.FuncExpr
(1) assertion failure
Wraps: (2) attached stack trace
  | github.com/cockroachdb/cockroach/pkg/util/errorutil.ShouldCatch
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/util/errorutil/catch.go:29
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).Build.func1
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:164
  | runtime.gopanic
  | 	/usr/local/go/src/runtime/panic.go:969
  | runtime.panicdottypeE
[02:12:25] :		 [TestRandomSyntaxFunctions] [Test Output]
  | 	/usr/local/go/src/runtime/iface.go:260
  | runtime.panicdottypeI
  | 	/usr/local/go/src/runtime/iface.go:270
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*scope).replaceSQLFn
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scope.go:1259
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*scope).VisitPre
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scope.go:925
  | github.com/cockroachdb/cockroach/pkg/sql/sem/tree.WalkExpr
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/sem/tree/walk.go:711
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*scope).walkExprTree
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scope.go:387
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*scope).resolveType
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/scope.go:426
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).analyzeSelectList
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/project.go:150
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).analyzeProjectionList
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/project.go:84
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectClause
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:1045
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:982
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:955
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).processWiths
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/with.go:29
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildSelect
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/select.go:954
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmt
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:248
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:212
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).Build
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:183
  | github.com/cockroachdb/cockroach/pkg/sql.(*optPlanningCtx).buildExecMemo
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:475
  | github.com/cockroachdb/cockroach/pkg/sql.(*planner).makeOptimizerPlan
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:172
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).makeExecPlan
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:838
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).dispatchToExecutionEngine
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:727
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmtInOpenState
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:500
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:99
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1367
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).run
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1296
  | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:491
[02:12:25] :		 [TestRandomSyntaxFunctions] [Test Output]
  | github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).processCommandsAsync.func1
  | 	/go/src/github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:595
  | runtime.goexit
  | 	/usr/local/go/src/runtime/asm_amd64.s:1373
Wraps: (3) interface conversion: tree.TypedExpr is tree.dNull, not *tree.FuncExpr
  | -- cause hidden behind barrier
  | interface conversion: tree.TypedExpr is tree.dNull, not *tree.FuncExpr
  | (1) interface conversion: tree.TypedExpr is tree.dNull, not *tree.FuncExpr
  | Error types: (1) *runtime.TypeAssertionError
Error types: (1) *assert.withAssertionFailure (2) *withstack.withStack (3) *barriers.barrierError
    TestRandomSyntaxFunctions: rsg_test.go:739: Crash detected: 
        SELECT addgeometrycolumn(e'FP\x180olt':::STRING, '&':::STRING, e'\x05\x140aUbL\x06-':::STRING, NULL, 1255665578875315670:::INT8, e'\x1a\tv':::STRING, (-2193968290153873804):::INT8, true) 
@rohany rohany added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Jul 15, 2020
@rohany rohany mentioned this issue Jul 15, 2020
25 tasks
@rytaft
Copy link
Collaborator

rytaft commented Jul 15, 2020

Ack thanks!

@rytaft
Copy link
Collaborator

rytaft commented Jul 16, 2020

This bug was already fixed by #50992.

@rytaft rytaft closed this as completed Jul 16, 2020
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.
Projects
None yet
Development

No branches or pull requests

2 participants