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

bigcache panic for slice #235

Open
LIUHUANUCAS opened this issue Aug 19, 2020 · 2 comments
Open

bigcache panic for slice #235

LIUHUANUCAS opened this issue Aug 19, 2020 · 2 comments
Labels

Comments

@LIUHUANUCAS
Copy link

LIUHUANUCAS commented Aug 19, 2020

What is the issue you are having?

panic: runtime error: slice bounds out of range

goroutine 229 [running]:
github.com/allegro/bigcache/queue.(*BytesQueue).peek(0xc4201e25a8, 0x36, 0xc425e9e480, 0xc420055900, 0x44e395, 0xc42a35d110, 0x1b39d171, 0x198977d7a03ddf50)
        ****/src/github.com/allegro/bigcache/queue/bytes_queue.go:195 +0x22e
github.com/allegro/bigcache/queue.(*BytesQueue).Get(0xc4201e25a8, 0x36, 0xc09f58197aa79848, 0xc4201be20c, 0xc427c818a8, 0xc42a35d160, 0x50054c)
        ****src/github.com/allegro/bigcache/queue/bytes_queue.go:161 +0x35
github.com/allegro/bigcache.(*cacheShard).get(0xc4201e25a0, 0xc42ea01c70, 0xb, 0xc09f58197aa79848, 0xc42a35d268, 0x4f6d86, 0x5f3cdd9a, 0xce7cfca, 0x432f257b0d)
        ****/src/github.com/allegro/bigcache/shard.go:38 +0xa7
github.com/allegro/bigcache.(*BigCache).Get(0xc4202b2000, 0xc42ea01c70, 0xb, 0x9, 0xbd2a20, 0xe4f290, 0xc42b9b0900, 0xc425e13650)
        ****/src/github.com/allegro/bigcache/bigcache.go:93 +0x8a
main.getDocidlist(0xc42ea01c70, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0)

What is BigCache doing that it shouldn't?

Minimal, Complete, and Verifiable Example

When asking a question about a problem caused by your code, you will get much better answers if you provide code we can use to reproduce the problem. That code should be...

  • ...Minimal – Use as little code as possible that still produces the same problem
  • ...Complete – Provide all parts needed to reproduce the problem
  • ...Verifiable – Test the code you're about to provide to make sure it reproduces the problem

For more information on how to provide an MCVE, please see the Stack Overflow documentation.

Environment:

  • go env
  • bigcache version 2 years ago
// go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/share/*****"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build094546539=/tmp/go-build -gno-record-gcc-switches"
@siennathesane
Copy link
Collaborator

@LIUHUANUCAS can you please upgrade to the latest version of BigCache and try to reproduce the error?

@LIUHUANUCAS
Copy link
Author

@mxplusb latest version can't compile ,see the new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants