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

tablecodec.EncodeValue() benchmark function fail after pr/47522 #47752

Closed
tiancaiamao opened this issue Oct 18, 2023 · 2 comments · Fixed by #47742
Closed

tablecodec.EncodeValue() benchmark function fail after pr/47522 #47752

tiancaiamao opened this issue Oct 18, 2023 · 2 comments · Fixed by #47742
Labels
severity/minor sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@tiancaiamao
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

go test -tags intest github.com/pingcap/tidb/pkg/tablecodec -run TestBenchDaily -bench Ignore --outfile bench_daily.json

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

No error

3. What did you see instead (Required)

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

goroutine 72 [running]:
github.com/pingcap/tidb/pkg/tablecodec.flatten(0x442669?, {0x7, 0x0, 0x0, 0x0, {0x12d638c, 0x6}, {0xc00036e013, 0x1, 0x1}, ...}, ...)
        /home/genius/project/src/github.com/pingcap/tidb/pkg/tablecodec/tablecodec.go:401 +0x8d
github.com/pingcap/tidb/pkg/tablecodec.EncodeValue(0x11a6c20?, {0xc000098b78, 0x0, 0x10}, {0x7, 0x0, 0x0, 0x0, {0x12d638c, 0x6}, ...})
        /home/genius/project/src/github.com/pingcap/tidb/pkg/tablecodec/tablecodec.go:328 +0xa5
github.com/pingcap/tidb/pkg/tablecodec.BenchmarkEncodeValue(0xc00034c000)
        /home/genius/project/src/github.com/pingcap/tidb/pkg/tablecodec/tablecodec_test.go:568 +0x5c5
testing.(*B).runN(0xc00034c000, 0x1)
        /home/genius/project/go/src/testing/benchmark.go:193 +0x102
testing.(*B).run1.func1()
        /home/genius/project/go/src/testing/benchmark.go:233 +0x4e
created by testing.(*B).run1 in goroutine 50
        /home/genius/project/go/src/testing/benchmark.go:226 +0x90
exit status 2
FAIL    github.com/pingcap/tidb/pkg/tablecodec  7.580s

I need to check is there anything wrong, or break by that commit

4. What is your TiDB version? (Required)

master

@tiancaiamao tiancaiamao added the type/bug The issue is confirmed as a bug. label Oct 18, 2023
@tiancaiamao
Copy link
Contributor Author

Ref #25754

@Ranxy
Copy link
Contributor

Ranxy commented Oct 19, 2023

This seems to be because PR modified https://github.com/pingcap/tidb/blob/master/pkg/tablecodec/tablecodec.go#L401 and changed the parameter from sc to sc.TypeCtx, but in the benchmark test sc is nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants