SEGV in go string map during HashAgg final process
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
TiDB version v7.5.6
```go
unexpected fault address 0x1000000000010
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1000000000010 pc=0x1d40a1c]
goroutine 32003363915 [running]:
runtime.throw({0x57a9db5?, 0x1d3a8c4?})
/usr/local/go/src/runtime/panic.go:1077 +0x40 fp=0x40feac5c10 sp=0x40feac5be0 pc=0x1d68960
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:875 +0x22c fp=0x40feac5c70 sp=0x40feac5c10 pc=0x1d81e6c
runtime.mapaccess2_faststr(0x5172420, 0x50dc8e3d10, {0x42f3cdaf58, 0x6})
/usr/local/go/src/runtime/map_faststr.go:192 +0x18c fp=0x40feac5cf0 sp=0x40feac5c80 pc=0x1d40a1c
github.com/pingcap/tidb/pkg/executor/aggregate.(*baseHashAggWorker).getPartialResult(0x4c84c32400, 0x13c0?, {0x41287bc000, 0x400, 0x49199a5b20?}, 0x50dc8e3d10)
/workspace/source/tidb/pkg/executor/aggregate/agg_hash_base_worker.go:62 +0xd0 fp=0x40feac5d80 sp=0x40feac5cf0 pc=0x487bba0
github.com/pingcap/tidb/pkg/executor/aggregate.(*HashAggFinalWorker).consumeIntermData(0x4c84c32400, {0x61fe8d8, 0x4c6fc1c000})
/workspace/source/tidb/pkg/executor/aggregate/agg_hash_final_worker.go:97 +0x308 fp=0x40feac5f20 sp=0x40feac5d80 pc=0x4880058
github.com/pingcap/tidb/pkg/executor/aggregate.(*HashAggFinalWorker).run(0x4c84c32400, {0x61fe8d8, 0x4c6fc1c000}, 0x49fbba78a0)
/workspace/source/tidb/pkg/executor/aggregate/agg_hash_final_worker.go:182 +0x88 fp=0x40feac5fa0 sp=0x40feac5f20 pc=0x4880da8
github.com/pingcap/tidb/pkg/executor/aggregate.(*HashAggExec).prepare4ParallelExec.func5()
/workspace/source/tidb/pkg/executor/aggregate/agg_hash_executor.go:440 +0x34 fp=0x40feac5fd0 sp=0x40feac5fa0 pc=0x487e294
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x40feac5fd0 sp=0x40feac5fd0 pc=0x1da25b4
created by github.com/pingcap/tidb/pkg/executor/aggregate.(*HashAggExec).prepare4ParallelExec in goroutine 32003362430
/workspace/source/tidb/pkg/executor/aggregate/agg_hash_executor.go:440 +0x2fc
```
Contributor guide
Research direction
Start with pkg/executor/aggregate/agg_hash_base_worker.go:62 and trace the call path through agg_hash_final_worker.go:97, agg_hash_final_worker.go:182, and agg_hash_executor.go:440. Use the reported mapaccess2_faststr crash and HashAgg final-process flow to determine what invalid state reaches the string map. Done means the SEGV cause is isolated and a regression test or other reproducible validation covers the failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100