redis / go-redis

Redis Go client
https://redis.uptrace.dev
BSD 2-Clause "Simplified" License
19.6k stars 2.31k forks source link

panic: runtime error: invalid memory address or nil pointer dereference #3002

Open Duanshouze opened 1 month ago

Duanshouze commented 1 month ago

Issue tracker is used for reporting bugs and discussing new features. Please use stackoverflow for supporting issues.

Expected Behavior

Current Behavior

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

goroutine 144316890 [running]: github.com/go-redis/redis/v8/internal/pool.(Conn).WithWriter(0xc016f805a0, {0x1e1f4c8?, 0xc010c98f00?}, 0x7270223a22796765?, 0xc0035ceee0) /usr/local/app/go/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/internal/pool/conn.go:76 +0x3e github.com/go-redis/redis/v8.(baseClient).pipelineProcessCmds(0xc016f805f0, {0x1e1f4c8, 0xc010c98f00}, 0x64696d227b3a3270?, {0xc01baeb290, 0x1, 0x1}) /usr/local/app/go/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/redis.go:439 +0x85 github.com/go-redis/redis/v8.(baseClient)._generalProcessPipeline.func1({0x1e1f4c8?, 0xc010c98f00?}, 0x303a22746e756f43?) /usr/local/app/go/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/redis.go:426 +0x3d github.com/go-redis/redis/v8.(baseClient).withConn.func2() /usr/local/app/go/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/redis.go:291 +0x36 created by github.com/go-redis/redis/v8.(*baseClient).withConn /usr/local/app/go/pkg/mod/github.com/go-redis/redis/v8@v8.11.5/redis.go:291 +0x20a

Possible Solution

Steps to Reproduce

1. 2. 3. 4.

Context (Environment)

Detailed Description

version: github.com/go-redis/redis/v8 v8.11.5 problem scenario: Nearly two million calls per minute are made to interfaces such as "redis/hgetall" and "redis/set" panic_redis_pointer

Possible Implementation

Duanshouze commented 1 month ago

When the number of calls to Redis-related interfaces such as 'redis/hgetall' suddenly increases, the above-mentioned exception occurs, accompanied by a sudden increase in disk block device read bandwidth. 主调接口数量变化 磁盘块设备读取带宽