Skip to content

Crash in infoschema.FormatTiDBVersion #39059

@secsys-go

Description

@secsys-go

Bug Report

We used the Fuzz engine to modify some Test(TestFormatVersion) data, and then the following crash appeared. We hope to get the help of the developer to confirm whether it is a real bug.

1. Minimal reproduce step (Required)

Simplified Test Code

infoschema.FormatTiDBVersion("5.7.2Delta;5-TiDB-", true)

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

Test Passed

3. What did you see instead (Required)

Crash Log

panic: runtime error: index out of range [0] with length 0 [recovered]
	panic: runtime error: index out of range [0] with length 0

goroutine 125 [running]:
testing.tRunner.func1.2({0x373e4a0, 0xc0005bae70})
	/home/gogen/.local/go/src/testing/testing.go:1209 +0x24e
testing.tRunner.func1()
	/home/gogen/.local/go/src/testing/testing.go:1212 +0x218
panic({0x373e4a0, 0xc0005bae70})
	/home/gogen/.local/go/src/runtime/panic.go:1038 +0x215
github.com/pingcap/tidb/infoschema.FormatTiDBVersion({0x3939818, 0x12}, 0x0)
	/home/gogen/workspace/gowork/src/topproj/tidb/infoschema/tables.go:1615 +0x179
github.com/pingcap/tidb/infoschema_test.FuzzTestFormatVersion({0xc000436800, 0x22, 0x200})
	/home/gogen/workspace/gowork/src/topproj/tidb/infoschema/tables_test.go_TestFormatVersion_test.go:27 +0x9b

4. What is your TiDB version? (Required)

9c4f94d

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions