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

Panic in nspcc-dev/neofs-api-go/v2/session.(*RequestMetaHeader).StableMarshal during benchmark #123

Closed
roman-khimov opened this issue Jun 30, 2021 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@roman-khimov
Copy link
Member

Using setup from #102 (comment) works for one thread but four threads could lead to this:

goroutine 24046 [running]:
net/http.(*conn).serve.func1(0xc0004f4000)
        net/http/server.go:1824 +0x153
panic(0xde3620, 0xc000220228)
        runtime/panic.go:971 +0x499
github.com/nspcc-dev/neofs-api-go/v2/session.(*RequestMetaHeader).StableMarshal(0xc00147e230, 0xc0006fc1c0, 0x1bd, 0x1bd, 0x450d8c, 0x1bd, 0xd10e00, 0xc00147e201, 0xc0006fc1c0)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/v2/session/marshal.go:566 +0x676
github.com/nspcc-dev/neofs-api-go/v2/signature.StableMarshalerWrapper.ReadSignedData(...)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/v2/signature/sign.go:120
github.com/nspcc-dev/neofs-api-go/util/signature.dataForSignature(0xffa080, 0xc000da0350, 0xd10e00, 0x101, 0x203000, 0x203000, 0x203000)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/util/signature/util.go:29 +0xbe
github.com/nspcc-dev/neofs-api-go/util/signature.DataSignature(0xc00051c0f0, 0xffa080, 0xc000da0350, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/util/signature/data.go:31 +0x92
github.com/nspcc-dev/neofs-api-go/util/signature.SignDataWithHandler(0xc00051c0f0, 0xffa080, 0xc000da0350, 0xc000da0360, 0x0, 0x0, 0x0, 0x0, 0x0)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/util/signature/data.go:47 +0x73
github.com/nspcc-dev/neofs-api-go/v2/signature.signServiceMessagePart(0xc00051c0f0, 0xff9ce8, 0xc00147e230, 0xc0002d28a0, 0x0, 0x0)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/v2/signature/sign.go:213 +0xc5
github.com/nspcc-dev/neofs-api-go/v2/signature.SignServiceMessage(0xc00051c0f0, 0xde69e0, 0xc00000c558, 0xc000da0310, 0x2)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/v2/signature/sign.go:191 +0x27c
github.com/nspcc-dev/neofs-api-go/pkg/client.(*clientImpl).SearchObject(0xc0001c67c0, 0x10026d8, 0xc000a779e0, 0xc00013cf60, 0xc000da02b0, 0x2, 0x2, 0x2, 0x2, 0x0, ...)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/pkg/client/object.go:1253 +0x405
github.com/nspcc-dev/neofs-sdk-go/pkg/pool.(*pool).SearchObject(0xc000208d80, 0x10026d8, 0xc000a779e0, 0xc00013cf60, 0xc000148090, 0x1, 0x1, 0x2, 0x0, 0x0, ...)
        github.com/nspcc-dev/neofs-sdk-go@v0.0.0-20210624072335-0348eb331c92/pkg/pool/pool.go:285 +0xf3
github.com/nspcc-dev/neofs-s3-gw/api/layer.(*layer).objectSearch(0xc00021cba0, 0x10026d8, 0xc000a779e0, 0xc0002d2c80, 0x3, 0xc000b889e5, 0xc000db6978, 0xc000abb040, 0xc000db6c60)
        github.com/nspcc-dev/neofs-s3-gw/api/layer/object.go:46 +0x2b9
github.com/nspcc-dev/neofs-s3-gw/api/layer.(*layer).objectFindID(0xc00021cba0, 0x10026d8, 0xc000a779e0, 0xc0002d2c80, 0x7, 0xc000abb040, 0x0)
        github.com/nspcc-dev/neofs-s3-gw/api/layer/object.go:52 +0x4d
github.com/nspcc-dev/neofs-s3-gw/api/layer.(*layer).GetObjectInfo(0xc00021cba0, 0x10026d8, 0xc000a779e0, 0xc000b889e5, 0x7, 0xc000b889ed, 0xa, 0x203000, 0xc0002d2fb0, 0x40db9b)
        github.com/nspcc-dev/neofs-s3-gw/api/layer/layer.go:357 +0x325
github.com/nspcc-dev/neofs-s3-gw/api/handler.(*handler).GetObjectHandler(0xc00021cbe8, 0x10001c8, 0xc0008f5540, 0xc0001b0a00)
        github.com/nspcc-dev/neofs-s3-gw/api/handler/get.go:131 +0x1a5
net/http.HandlerFunc.ServeHTTP(...)
        net/http/server.go:2069
github.com/nspcc-dev/neofs-s3-gw/api/metrics.APIStats.func1(0x1000198, 0xc000b0d470, 0xc0001b0a00)
        github.com/nspcc-dev/neofs-s3-gw/api/metrics/api.go:122 +0x215
net/http.HandlerFunc.ServeHTTP(...)
        net/http/server.go:2069
github.com/nspcc-dev/neofs-s3-gw/api.(*maxClients).Handle.func1(0x1000198, 0xc000b0d470, 0xc0001b0a00)
        github.com/nspcc-dev/neofs-s3-gw/api/max-clients.go:49 +0x38e
net/http.HandlerFunc.ServeHTTP(0xc00021d248, 0x1000198, 0xc000b0d470, 0xc0001b0a00)
        net/http/server.go:2069 +0x44
github.com/nspcc-dev/neofs-s3-gw/api.AttachUserAuth.func1.1(0x1000198, 0xc000b0d470, 0xc000516700)
        github.com/nspcc-dev/neofs-s3-gw/api/user-auth.go:37 +0x4ea
net/http.HandlerFunc.ServeHTTP(0xc000b0d380, 0x1000198, 0xc000b0d470, 0xc000516700)
        net/http/server.go:2069 +0x44
github.com/nspcc-dev/neofs-s3-gw/api.logErrorResponse.func1.1(0x1000ee8, 0xc0000c6540, 0xc000516700)
        github.com/nspcc-dev/neofs-s3-gw/api/router.go:140 +0xbe
net/http.HandlerFunc.ServeHTTP(0xc0006a9b40, 0x1000ee8, 0xc0000c6540, 0xc000516700)
        net/http/server.go:2069 +0x44
github.com/nspcc-dev/neofs-s3-gw/api.setRequestID.func1(0x1000ee8, 0xc0000c6540, 0xc000516500)
        github.com/nspcc-dev/neofs-s3-gw/api/router.go:130 +0x537
net/http.HandlerFunc.ServeHTTP(0xc000bf2720, 0x1000ee8, 0xc0000c6540, 0xc000516500)
        net/http/server.go:2069 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc00074a540, 0x1000ee8, 0xc0000c6540, 0xc000516400)
        github.com/gorilla/mux@v1.8.0/mux.go:210 +0xd3
net/http.serverHandler.ServeHTTP(0xc0000c62a0, 0x1000ee8, 0xc0000c6540, 0xc000516400)
        net/http/server.go:2887 +0xa3
net/http.(*conn).serve(0xc0004f4000, 0x10026d8, 0xc000c62140)
        net/http/server.go:1952 +0x8cd

I'm not sure it's a gateway fault, needs to be investigated further.

@roman-khimov roman-khimov added the bug Something isn't working label Jun 30, 2021
@roman-khimov roman-khimov added this to the v0.16.0 milestone Jun 30, 2021
@roman-khimov
Copy link
Member Author

One more:

2021-06-30T23:15:06.578+0300    info    http/server.go:3137     http: panic serving [::1]:38810: runtime error: slice bounds out of range [482:445]
goroutine 126 [running]:
net/http.(*conn).serve.func1(0xc00029e1e0)
        net/http/server.go:1824 +0x153
panic(0xde3620, 0xc0007e6030)
        runtime/panic.go:971 +0x499
github.com/nspcc-dev/neofs-api-go/v2/session.(*RequestMetaHeader).StableMarshal(0xc0006a6870, 0xc0005b0000, 0x1bd, 0x1bd, 0x450d8c, 0x1bd, 0xd10e00, 0xc0006a6801, 0xc0005b0000)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/v2/session/marshal.go:566 +0x676
github.com/nspcc-dev/neofs-api-go/v2/signature.StableMarshalerWrapper.ReadSignedData(...)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/v2/signature/sign.go:120
github.com/nspcc-dev/neofs-api-go/util/signature.dataForSignature(0xffa080, 0xc00078a580, 0xd10e00, 0x1, 0x203000, 0x203000, 0x203000)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/util/signature/util.go:29 +0xbe
github.com/nspcc-dev/neofs-api-go/util/signature.DataSignature(0xc0004fc0c0, 0xffa080, 0xc00078a580, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/util/signature/data.go:31 +0x92
github.com/nspcc-dev/neofs-api-go/util/signature.SignDataWithHandler(0xc0004fc0c0, 0xffa080, 0xc00078a580, 0xc00078a590, 0x0, 0x0, 0x0, 0x0, 0x0)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/util/signature/data.go:47 +0x73
github.com/nspcc-dev/neofs-api-go/v2/signature.signServiceMessagePart(0xc0004fc0c0, 0xff9ce8, 0xc0006a6870, 0xc0004f0678, 0x0, 0x0)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/v2/signature/sign.go:213 +0xc5
github.com/nspcc-dev/neofs-api-go/v2/signature.SignServiceMessage(0xc0004fc0c0, 0xde67e0, 0xc0003b8390, 0xc00078a310, 0x1)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/v2/signature/sign.go:191 +0x27c
github.com/nspcc-dev/neofs-api-go/pkg/client.(*clientImpl).PutObject(0xc00007c820, 0x10026d8, 0xc000742cc0, 0xc0003b8378, 0xc00078a2e0, 0x2, 0x2, 0x2, 0x2, 0x0)
        github.com/nspcc-dev/neofs-api-go@v1.28.0/pkg/client/object.go:267 +0x485
github.com/nspcc-dev/neofs-sdk-go/pkg/pool.(*pool).PutObject(0xc0000e8700, 0x10026d8, 0xc000742cc0, 0xc0003b8378, 0xc0000a82b0, 0x1, 0x1, 0x2, 0x1, 0x1)
        github.com/nspcc-dev/neofs-sdk-go@v0.0.0-20210624072335-0348eb331c92/pkg/pool/pool.go:229 +0xe5
github.com/nspcc-dev/neofs-s3-gw/api/layer.(*layer).objectPut(0xc00009e2b8, 0x10026d8, 0xc000742cc0, 0xc0006c60c0, 0xd556c0, 0xfda833, 0x0)
        github.com/nspcc-dev/neofs-s3-gw/api/layer/object.go:136 +0x88b
github.com/nspcc-dev/neofs-s3-gw/api/layer.(*layer).PutObject(0xc00009e2b8, 0x10026d8, 0xc000742cc0, 0xc0006c60c0, 0xc0007ee7f8, 0xc0000e8380, 0x0)
        github.com/nspcc-dev/neofs-s3-gw/api/layer/layer.go:376 +0x49
github.com/nspcc-dev/neofs-s3-gw/api/handler.(*handler).PutObjectHandler(0xc00009e300, 0x10001c8, 0xc0007ab040, 0xc0007e4900)
        github.com/nspcc-dev/neofs-s3-gw/api/handler/put.go:56 +0x828
net/http.HandlerFunc.ServeHTTP(...)
        net/http/server.go:2069
github.com/nspcc-dev/neofs-s3-gw/api/metrics.APIStats.func1(0x1000198, 0xc000662540, 0xc0007e4900)
        github.com/nspcc-dev/neofs-s3-gw/api/metrics/api.go:122 +0x215
net/http.HandlerFunc.ServeHTTP(...)
        net/http/server.go:2069
github.com/nspcc-dev/neofs-s3-gw/api.(*maxClients).Handle.func1(0x1000198, 0xc000662540, 0xc0007e4900)
        github.com/nspcc-dev/neofs-s3-gw/api/max-clients.go:49 +0x38e
net/http.HandlerFunc.ServeHTTP(0xc00009ec30, 0x1000198, 0xc000662540, 0xc0007e4900)
        net/http/server.go:2069 +0x44
github.com/nspcc-dev/neofs-s3-gw/api.AttachUserAuth.func1.1(0x1000198, 0xc000662540, 0xc000660600)
        github.com/nspcc-dev/neofs-s3-gw/api/user-auth.go:37 +0x4ea
net/http.HandlerFunc.ServeHTTP(0xc000662150, 0x1000198, 0xc000662540, 0xc000660600)
        net/http/server.go:2069 +0x44
github.com/nspcc-dev/neofs-s3-gw/api.logErrorResponse.func1.1(0x1000ee8, 0xc0000108c0, 0xc000660600)
        github.com/nspcc-dev/neofs-s3-gw/api/router.go:140 +0xbe
net/http.HandlerFunc.ServeHTTP(0xc002186240, 0x1000ee8, 0xc0000108c0, 0xc000660600)
        net/http/server.go:2069 +0x44
github.com/nspcc-dev/neofs-s3-gw/api.setRequestID.func1(0x1000ee8, 0xc0000108c0, 0xc000660200)
        github.com/nspcc-dev/neofs-s3-gw/api/router.go:130 +0x537
net/http.HandlerFunc.ServeHTTP(0xc00000c210, 0x1000ee8, 0xc0000108c0, 0xc000660200)
        net/http/server.go:2069 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0007b20c0, 0x1000ee8, 0xc0000108c0, 0xc000660500)
        github.com/gorilla/mux@v1.8.0/mux.go:210 +0xd3
net/http.serverHandler.ServeHTTP(0xc0000101c0, 0x1000ee8, 0xc0000108c0, 0xc000660500)
        net/http/server.go:2887 +0xa3
net/http.(*conn).serve(0xc00029e1e0, 0x10026d8, 0xc00063e880)
        net/http/server.go:1952 +0x8cd
created by net/http.(*Server).Serve
        net/http/server.go:3013 +0x39b

@KirillovDenis
Copy link
Contributor

Should we close this because nspcc-dev/neofs-api-go#323? @alexvanin @roman-khimov

@alexvanin
Copy link
Contributor

@KirillovDenis let's wait for the fix and make sure that these errors will be gone after neofs-api-go update.

@KirillovDenis
Copy link
Contributor

Couldn't reproduce using api v1.28.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants