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

Invalid memory address or nil pointer when upgrade to master version #56489

Closed
apollodafoni opened this issue Oct 9, 2024 · 2 comments · Fixed by #56517
Closed

Invalid memory address or nil pointer when upgrade to master version #56489

apollodafoni opened this issue Oct 9, 2024 · 2 comments · Fixed by #56517
Assignees
Labels

Comments

@apollodafoni
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
create database if not exists v1static;
set global tidb_analyze_version = 1;
set global tidb_partition_prune_mode = 'static';
set session tidb_enable_list_partition = 1;
create table rptcon (a bigint primary key, b varchar(20)) partition by range(a) (partition p0 values less than (10), partition p1 values less than (20), partition p2 values less than(30));
create table hptcon (a bigint primary key, b varchar(20)) partition by hash(a) partitions 3;
create table lptcon (a bigint primary key, b varchar(20)) partition by list(a) (partition p0 values in (1,2,3), partition p1 values in (14,16,18), partition p3 values in (20,25,27,29));
insert into rptcon values (1, 'a'), (2, 'b'), (3,'c'), (14, 'd'), (16, 'e'), (18, 'f'), (20, 'h'), (25, 'i'), (27, 'j'), (29, 'k');
insert into hptcon values (1, 'a'), (2, 'b'), (3,'c'), (14, 'd'), (16, 'e'), (18, 'f'), (20, 'h'), (25, 'i'), (27, 'j'), (29, 'k');
insert into lptcon values (1, 'a'), (2, 'b'), (3,'c'), (14, 'd'), (16, 'e'), (18, 'f'), (20, 'h'), (25, 'i'), (27, 'j'), (29, 'k');
drop stats rptcon;
drop stats hptcon;
drop stats lptcon;
analyze table rptcon  with 10 buckets;
analyze table hptcon  with 10 buckets;
analyze table lptcon  with 10 buckets;

before upgrade tidb version

Release Version: v8.0.0
Edition: Community
Git Commit Hash: 8ba1fa452b1ccdbfb85879ea94b9254aabba2916
Git Branch: HEAD
UTC Build Time: 2024-03-28 14:22:15
GoVersion: go1.21.4
Race Enabled: false
Check Table Before Drop: false
Store: tikv

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

use operator upgrade cluster to master version success

3. What did you see instead (Required)

start tidb-server ...
/tidb-server --store=tikv --advertise-address=cluster-tidb-1.cluster-tidb-peer.oltp-global-stats-update-tps-7632425-1-763.svc --host=0.0.0.0 --path=cluster-pd:2379 --config=/etc/tidb/tidb.toml

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x3bb741a]

goroutine 1 [running]:
github.com/pingcap/tidb/pkg/infoschema.(*infoschemaV2).TableByID(0xc002177d48, {0x0, 0x0}, 0x74)
	/workspace/source/tidb/pkg/infoschema/infoschema_v2.go:625 +0x19a
github.com/pingcap/tidb/pkg/session.rebuildAllPartitionValueMapAndSorted(0xc00164c788)
	/workspace/source/tidb/pkg/session/bootstrap.go:3578 +0x193
github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl({0x6fec9e0, 0xc001057320}, 0x689c448)
	/workspace/source/tidb/pkg/session/session.go:3508 +0x5f9
github.com/pingcap/tidb/pkg/session.BootstrapSession(...)
	/workspace/source/tidb/pkg/session/session.go:3397
main.createStoreAndDomain({0x0?, 0x675fc28?})
	/workspace/source/tidb/cmd/tidb-server/main.go:414 +0x1b4
main.main()
	/workspace/source/tidb/cmd/tidb-server/main.go:320 +0x3c5

4. What is your TiDB version? (Required)

@apollodafoni apollodafoni added the type/bug The issue is confirmed as a bug. label Oct 9, 2024
@apollodafoni
Copy link
Author

/assign @tiancaiamao
/severity major

@tiancaiamao
Copy link
Contributor

OK, I can reproduce it follow above steps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants