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

nil point panic in session.session#TxnInfo() method. #43829

Closed
wuhuizuo opened this issue May 15, 2023 · 3 comments · Fixed by #44486
Closed

nil point panic in session.session#TxnInfo() method. #43829

wuhuizuo opened this issue May 15, 2023 · 3 comments · Fixed by #44486
Assignees
Labels
affects-5.1 This bug affects 5.1.x versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.0 affects-7.1 This bug affects the 7.1.x(LTS) versions. report/community The community has encountered this bug. severity/major sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.

Comments

@wuhuizuo
Copy link
Contributor

wuhuizuo commented May 15, 2023

Description

test failed in tispark CI job:

[2023-05-15T08:42:18.237Z] [2023/05/15 16:41:38.033 +08:00] [INFO] [index_cop.go:230] ["[ddl-ingest] close cop-request sender pool"]
[2023-05-15T08:42:18.237Z] [2023/05/15 16:41:38.033 +08:00] [INFO] [index_cop.go:131] ["[ddl-ingest] start a cop-request task"] [id=1] [task="taskID: 1, physicalTableID: 225, range: [7480000000000000e15f72, 7480000000000000e15f73], jobID: 227"]
[2023-05-15T08:42:18.237Z] [2023/05/15 16:41:38.034 +08:00] [INFO] [backfilling_scheduler.go:478] ["[ddl-ingest] finish a cop-request task"] [id=1]
[2023-05-15T08:42:18.237Z] [2023/05/15 16:41:38.036 +08:00] [INFO] [backfilling.go:456] ["[ddl] backfill workers successfully processed"] [element=ID:1,TypeKey:_idx_] ["total added count"=0] ["start key"=]
[2023-05-15T08:42:18.237Z] [2023/05/15 16:41:38.036 +08:00] [INFO] [reorg.go:233] ["[ddl] run reorg job done"] ["handled rows"=0]
[2023-05-15T08:42:18.237Z] [2023/05/15 16:41:38.036 +08:00] [INFO] [domain.go:663] ["infoSyncerKeeper exited."]
[2023-05-15T08:42:18.237Z] [2023/05/15 16:41:38.036 +08:00] [INFO] [wait_group_wrapper.go:137] ["background process exited"] [source=domain] [process=infoSyncerKeeper]
[2023-05-15T08:42:18.237Z] [2023/05/15 16:41:38.036 +08:00] [INFO] [engine.go:121] ["[ddl-ingest] flush all writer and get closed engine"] ["job ID"=227] ["index ID"=1]
[2023-05-15T08:42:18.237Z] panic: runtime error: invalid memory address or nil pointer dereference
[2023-05-15T08:42:18.237Z] [signal SIGSEGV: segmentation violation code=0x1 addr=0x110 pc=0x457b761]
[2023-05-15T08:42:18.237Z] 
[2023-05-15T08:42:18.237Z] goroutine 14160 [running]:
[2023-05-15T08:42:18.237Z] github.com/pingcap/tidb/session.(*session).TxnInfo(0xc0009d9180)
[2023-05-15T08:42:18.237Z] 	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/session/session.go:546 +0x141
[2023-05-15T08:42:18.237Z] github.com/pingcap/tidb/session.GetStartTSFromSession({0x506df20?, 0xc0009d9180?})
[2023-05-15T08:42:18.237Z] 	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/session/session.go:3814 +0xce
[2023-05-15T08:42:18.237Z] github.com/pingcap/tidb/server.(*Server).GetInternalSessionStartTSList(0xc0010527e0)
[2023-05-15T08:42:18.237Z] 	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/server/server.go:960 +0x20c
[2023-05-15T08:42:18.237Z] github.com/pingcap/tidb/domain/infosync.(*InfoSyncer).ReportMinStartTS(0xc001e765a0, {0x58f8fc8, 0xc00072f4a0})
[2023-05-15T08:42:18.237Z] 	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/domain/infosync/info.go:802 +0x82
[2023-05-15T08:42:18.237Z] github.com/pingcap/tidb/domain.(*Domain).infoSyncerKeeper(0xc00151d1e0)
[2023-05-15T08:42:18.237Z] 	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/domain/domain.go:671 +0x42a
[2023-05-15T08:42:18.237Z] github.com/pingcap/tidb/util.(*WaitGroupEnhancedWrapper).Run.func1()
[2023-05-15T08:42:18.237Z] 	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/util/wait_group_wrapper.go:96 +0x77
[2023-05-15T08:42:18.237Z] created by github.com/pingcap/tidb/util.(*WaitGroupEnhancedWrapper).Run
[2023-05-15T08:42:18.237Z] 	/home/jenkins/agent/workspace/build_tidb_multi_branch_master/go/src/github.com/pingcap/tidb/util/wait_group_wrapper.go:91 +0xcc

detail log:

TiDB Version

  • branch: master
  • commit sha256: 6043234

Information

It should judge the point before get the field from it.
Ref:

tidb/session/session.go

Lines 545 to 546 in 6043234

processInfo := s.ShowProcess()
txnInfo.ConnectionID = processInfo.ID

@wuhuizuo wuhuizuo changed the title nil point panic nil point panic in session.session#TxnInfo() method. May 15, 2023
@wuhuizuo wuhuizuo added the type/bug The issue is confirmed as a bug. label May 15, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels May 15, 2023
@zimulala
Copy link
Contributor

When running TiDB locally on a mac, kill TiDB by "ctrl+c" mostly has this problem.

@zimulala zimulala self-assigned this Jun 6, 2023
@zimulala zimulala added affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.2 affects-6.3 affects-6.4 affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-6.6 affects-7.0 affects-7.1 This bug affects the 7.1.x(LTS) versions. labels Jun 7, 2023
@ti-chi-bot ti-chi-bot bot removed may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. labels Jun 7, 2023
@zimulala
Copy link
Contributor

The possibility of panic caused by this PR(#42897) is relatively greater

@seiya-annie
Copy link

/found community

@ti-chi-bot ti-chi-bot bot added the report/community The community has encountered this bug. label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.1 This bug affects 5.1.x versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.0 affects-7.1 This bug affects the 7.1.x(LTS) versions. report/community The community has encountered this bug. severity/major sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants