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

v4.0.1 upgrade to 4.0.14, panic in the recoverable goroutine, report invalid memory address or nil pointer dereference #26266

Closed
seiya-annie opened this issue Jul 15, 2021 · 6 comments
Labels
duplicate Issues or pull requests already exists. severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@seiya-annie
Copy link

seiya-annie commented Jul 15, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

[2021/07/15 12:35:43.748 +08:00] [WARN] [session.go:1384] ["run statement failed"] [conn=20] [schemaVersion=153] [error="runtime error: invalid memory address or nil pointer dereference"] [session="{\n  \"currDBName\": \"db1__5cbb8343_58ea_46ff_86eb_62f278576eed\",\n  \"id\": 20,\n  \"status\": 3,\n  \"strictMode\": true,\n  \"txn\": \"426331011443589126\",\n  \"user\": {\n    \"Username\": \"root\",\n    \"Hostname\": \"10.0.2.178\",\n    \"CurrentUser\": false,\n    \"AuthUsername\": \"root\",\n    \"AuthHostname\": \"%\"\n  }\n}"]
[2021/07/15 12:35:43.748 +08:00] [INFO] [conn.go:800] ["command dispatched failed"] [conn=20] [connInfo="id:20, addr:10.0.2.178:49106 status:11, collation:utf8mb4_general_ci, user:root"] [command=Query] [status="inTxn:1, autocommit:1"] [sql="(select  * from t1, t2 where t1.c_str = 'fervent tereshkova' ) union all (select /*+ HASH_JOIN(t1,t2) */  * from t1 join t2 on t1.c_int = t2.c_int where t2.c_int in (5, 9, 10) for update)"] [txn_mode=PESSIMISTIC] [err="runtime error: invalid memory address or nil pointer dereference\ngit.luolix.top/pingcap/tidb/executor.(*HashJoinExec).fetchAndBuildHashTable.func3\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/join.go:703\ngit.luolix.top/pingcap/tidb/util.WithRecovery.func1\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/util/misc.go:88\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:679\nruntime.panicmem\n\t/usr/local/go/src/runtime/panic.go:199\nruntime.sigpanic\n\t/usr/local/go/src/runtime/signal_unix.go:394\ngit.luolix.top/pingcap/parser/model.(*ColumnInfo).GetOriginDefaultValue\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/pkg/mod/github.com/pingcap/parser@v0.0.0-20210421190550-451a84cf120a/model/model.go:147\ngit.luolix.top/pingcap/tidb/table.GetColOriginDefaultValue\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/table/column.go:461\ngit.luolix.top/pingcap/tidb/executor.NewRowDecoder.func2\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/builder.go:3079\ngit.luolix.top/pingcap/tidb/util/rowcodec.(*ChunkDecoder).DecodeToChunk\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/util/rowcodec/decoder.go:249\ngit.luolix.top/pingcap/tidb/executor.DecodeRowValToChunk\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/point_get.go:375\ngit.luolix.top/pingcap/tidb/executor.(*BatchPointGetExec).Next\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/batch_point_get.go:108\ngit.luolix.top/pingcap/tidb/executor.Next\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/executor.go:262\ngit.luolix.top/pingcap/tidb/executor.(*HashJoinExec).fetchBuildSideRows\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/join.go:266\ngit.luolix.top/pingcap/tidb/executor.(*HashJoinExec).fetchAndBuildHashTable.func2\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/join.go:699\ngit.luolix.top/pingcap/tidb/util.WithRecovery\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/util/misc.go:96\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357"]

[2021/07/15 12:02:05.276 +08:00] [ERROR] [conn.go:728] ["command dispatched failed"] [conn=61] [connInfo="id:61, addr:10.0.2.178:57980 status:11, collation:utf8mb4_general_ci, user:root"] [command=Query] [status="inTxn:1, autocommit:1"] [sql="insert into t (c_int, c_str, c_datetime, c_double) values (11, 'hopeful heyrovsky', '2020-03-17 01:02:17', 38.955678)"] [txn_mode=PESSIMISTIC] [err="[kv:1062]Duplicate entry '11' for key 'c_int'"]
[2021/07/15 12:02:05.469 +08:00] [WARN] [session.go:1040] ["run statement failed"] [conn=61] [schemaVersion=49] [error="cannot convert <nil>(type <nil>) to string"] [session="{\n  \"currDBName\": \"db1__3913ad88_67bc_4794_8c0e_cf40cf67068e\",\n  \"id\": 61,\n  \"status\": 3,\n  \"strictMode\": true,\n  \"txn\": \"426330482298847233\",\n  \"user\": {\n    \"Username\": \"root\",\n    \"Hostname\": \"10.0.2.178\",\n    \"CurrentUser\": false,\n    \"AuthUsername\": \"root\",\n    \"AuthHostname\": \"%\"\n  }\n}"]
@  

[2021/07/15 12:02:05.469 +08:00] [ERROR] [conn.go:728] ["command dispatched failed"] [conn=61] [connInfo="id:61, addr:10.0.2.178:57980 status:11, collation:utf8mb4_general_ci, user:root"] [command=Query] [status="inTxn:1, autocommit:1"] [sql="update t set c_datetime = c_timestamp, c_timestamp = '2020-01-05 13:36:43' where c_str in (null, 'vigorous bell', 'youthful tharp')"] [txn_mode=PESSIMISTIC] [err="cannot convert <nil>(type <nil>) to string\ngit.luolix.top/pingcap/tidb/types.(*Datum).ToString\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/types/datum.go:1671\ngit.luolix.top/pingcap/tidb/executor.encodeIndexKey\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/point_get.go:310\ngit.luolix.top/pingcap/tidb/executor.(*BatchPointGetExec).initialize\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/batch_point_get.go:152\ngit.luolix.top/pingcap/tidb/executor.(*BatchPointGetExec).Next\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/batch_point_get.go:89\ngit.luolix.top/pingcap/tidb/executor.Next\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/executor.go:248\ngit.luolix.top/pingcap/tidb/executor.(*UpdateExec).updateRows\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/update.go:157\ngit.luolix.top/pingcap/tidb/executor.(*UpdateExec).Next\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/update.go:125\ngit.luolix.top/pingcap/tidb/executor.Next\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/executor.go:248\ngit.luolix.top/pingcap/tidb/executor.(*ExecStmt).handleNoDelayExecutor\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/adapter.go:507\ngit.luolix.top/pingcap/tidb/executor.(*ExecStmt).handlePessimisticDML\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/adapter.go:526\ngit.luolix.top/pingcap/tidb/executor.(*ExecStmt).handleNoDelay\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/adapter.go:387\ngit.luolix.top/pingcap/tidb/executor.(*ExecStmt).Exec\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/executor/adapter.go:357\ngit.luolix.top/pingcap/tidb/session.runStmt\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/session/tidb.go:276\ngit.luolix.top/pingcap/tidb/session.(*session).executeStatement\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/session/session.go:1037\ngit.luolix.top/pingcap/tidb/session.(*session).execute\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/session/session.go:1150\ngit.luolix.top/pingcap/tidb/session.(*session).Execute\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/session/session.go:1080\ngit.luolix.top/pingcap/tidb/server.(*TiDBContext).Execute\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/server/driver_tidb.go:248\ngit.luolix.top/pingcap/tidb/server.(*clientConn).handleQuery\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/server/conn.go:1265\ngit.luolix.top/pingcap/tidb/server.(*clientConn).dispatch\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/server/conn.go:899\ngit.luolix.top/pingcap/tidb/server.(*clientConn).Run\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/server/conn.go:713\ngit.luolix.top/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-linux-amd64-4.0-githash/go/src/github.com/pingcap/tidb/server/server.go:415\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357"]

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@seiya-annie seiya-annie added type/bug The issue is confirmed as a bug. sig/execution SIG execution labels Jul 15, 2021
@ichn-hu
Copy link
Contributor

ichn-hu commented Jul 15, 2021

how is this reproduced?

@ichn-hu
Copy link
Contributor

ichn-hu commented Jul 15, 2021

do you have corresponding SQL and table schema?

@seiya-annie
Copy link
Author

errorinfo.txt

@qw4990
Copy link
Contributor

qw4990 commented Jul 15, 2021

caused by #21148 and its cherry-picks

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

@seiya-annie seiya-annie added the duplicate Issues or pull requests already exists. label Jul 15, 2021
@seiya-annie
Copy link
Author

#26250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues or pull requests already exists. severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants