hashicorp / golang-lru

Golang LRU cache
Mozilla Public License 2.0
4.26k stars 497 forks source link

panic during adding new element #71

Open kesonliu1983 opened 4 years ago

kesonliu1983 commented 4 years ago

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

goroutine 10662137 [running]: container/list.(List).remove(...) /usr/lib/golang/src/container/list/list.go:110 container/list.(List).Remove(...) /usr/lib/golang/src/container/list/list.go:143 github.com/hashicorp/golang-lru/simplelru.(LRU).removeElement(0xc0005962a0, 0xc002408000) /root/zip/majiang/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go:155 +0x39 github.com/hashicorp/golang-lru/simplelru.(LRU).removeOldest(0xc0005962a0) /root/zip/majiang/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go:149 +0x4c github.com/hashicorp/golang-lru/simplelru.(LRU).Add(0xc0005962a0, 0x11ab0a0, 0xc00b4ac2c0, 0x0, 0x0, 0xc00c49b501) /root/zip/majiang/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go:67 +0x2c1 github.com/hashicorp/golang-lru.(ARCCache).replace(0xc0002ec1c0, 0x0) /root/zip/majiang/vendor/github.com/hashicorp/golang-lru/arc.go:186 +0x96 github.com/hashicorp/golang-lru.(*ARCCache).Add(0xc0002ec1c0, 0x11ab0a0, 0xc00c49b5e0, 0x1380640, 0xc007c432c0) /root/zip/majiang/vendor/github.com/hashicorp/golang-lru/arc.go:163 +0x5b2

rukolahasser commented 3 years ago

I'm running into the similar error.