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

Stats panic invalid memory address or nil pointer dereference #58865

Open
lilinghai opened this issue Jan 10, 2025 · 0 comments
Open

Stats panic invalid memory address or nil pointer dereference #58865

lilinghai opened this issue Jan 10, 2025 · 0 comments
Labels
type/bug The issue is confirmed as a bug.

Comments

@lilinghai
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

million tables and dml

[2025/01/10 14:33:39.198 +00:00] [ERROR] [misc.go:116] ["panic in the recoverable goroutine"] [label=stats] [funcInfo=CallWithSCtx] [r="runtime error: invalid memory address or nil pointer dereference"] [stack="github.com/pingcap/tidb/pkg/util.Recover\n\t/workspace/source/tidb/pkg/util/misc.go:120\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:785\nruntime.panicmem\n\t/usr/local/go/src/runtime/panic.go:262\nruntime.sigpanic\n\t/usr/local/go/src/runtime/signal_unix.go:917\ngithub.com/pingcap/tidb/pkg/statistics.(*Index).MemoryUsage\n\t/workspace/source/tidb/pkg/statistics/index.go:175\ngithub.com/pingcap/tidb/pkg/statistics.(*Table).MemoryUsage\n\t/workspace/source/tidb/pkg/statistics/table.go:578\ngithub.com/pingcap/tidb/pkg/statistics/handle/cache/internal/lfu.(*LFU).Put\n\t/workspace/source/tidb/pkg/statistics/handle/cache/internal/lfu/lfu_cache.go:101\ngithub.com/pingcap/tidb/pkg/statistics/handle/cache.(*StatsCache).Update\n\t/workspace/source/tidb/pkg/statistics/handle/cache/statscacheinner.go:170\ngithub.com/pingcap/tidb/pkg/statistics/handle/cache.(*StatsCacheImpl).UpdateStatsCache\n\t/workspace/source/tidb/pkg/statistics/handle/cache/statscache.go:269\ngithub.com/pingcap/tidb/pkg/statistics/handle/storage.loadNeededIndexHistograms\n\t/workspace/source/tidb/pkg/statistics/handle/storage/read.go:787\ngithub.com/pingcap/tidb/pkg/statistics/handle/storage.LoadNeededHistograms\n\t/workspace/source/tidb/pkg/statistics/handle/storage/read.go:595\ngithub.com/pingcap/tidb/pkg/statistics/handle/storage.(*statsReadWriter).LoadNeededHistograms.func1\n\t/workspace/source/tidb/pkg/statistics/handle/storage/stats_read_writer.go:264\ngithub.com/pingcap/tidb/pkg/statistics/handle/util.WrapTxn\n\t/workspace/source/tidb/pkg/statistics/handle/util/util.go:203\ngithub.com/pingcap/tidb/pkg/statistics/handle/util.CallWithSCtx\n\t/workspace/source/tidb/pkg/statistics/handle/util/util.go:101\ngithub.com/pingcap/tidb/pkg/statistics/handle/storage.(*statsReadWriter).LoadNeededHistograms\n\t/workspace/source/tidb/pkg/statistics/handle/storage/stats_read_writer.go:262\ngithub.com/pingcap/tidb/pkg/domain.(*Domain).asyncLoadHistogram\n\t/workspace/source/tidb/pkg/domain/domain.go:2621\ngithub.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run.func1\n\t/workspace/source/tidb/pkg/util/wait_group_wrapper.go:103"]

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

Release Version: v9.0.0-alpha-86-g1d0c33a
Edition: Community
Git Commit Hash: 1d0c33a
Git Branch: HEAD
UTC Build Time: 2025-01-10 04:57:00
GoVersion: go1.23.4
Race Enabled: false
Check Table Before Drop: false
Store: unistore

@lilinghai lilinghai added the type/bug The issue is confirmed as a bug. label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant