aerospike / aerospike-client-go

Aerospike Client Go
Apache License 2.0
430 stars 198 forks source link

slice bounds out of range panic error #312

Closed adranwit closed 3 years ago

adranwit commented 4 years ago

We've seen the following panic error

panic: runtime error: slice bounds out of range [:4294967303] with capacity 118696
goroutine 21877427535 [running]:
panic: runtime error: slice bounds out of range [:4294967303] with capacity 118696
goroutine 21877427535 [running]:
github.com/aerospike/aerospike-client-go/utils/buffer.BytesToUint32(...)
github.com/aerospike/aerospike-client-go/utils/buffer.BytesToUint32(...)
/go/src/github.vianttech.com/adelphic/mediator/vendor/github.com/aerospike/aerospike-client-go/utils/buffer/buffer.go:106
github.com/aerospike/aerospike-client-go.(*readCommand).parseRecord(0xc18a17a6e0, 0x14bf940, 0xc18a17a6e0, 0xc, 0x0, 0x13f2d00000004, 0x0, 0x0, 0xbfc6c00a24d2e68d)
/go/src/github.vianttech.com/adelphic/mediator/vendor/github.com/aerospike/aerospike-client-go/utils/buffer/buffer.go:106
github.com/aerospike/aerospike-client-go.(*readCommand).parseRecord(0xc18a17a6e0, 0x14bf940, 0xc18a17a6e0, 0xc, 0x0, 0x13f2d00000004, 0x0, 0x0, 0xbfc6c00a24d2e68d)
github.com/aerospike/aerospike-client-go.(*baseCommand).executeAt(0xc18a17a6e0, 0x14bf940, 0xc18a17a6e0, 0xc000de2f00, 0xc000de2f01, 0xbfc6c00a24d2e357, 0xe503dc309a7c, 0x1bd88a0, 0x0, 0x0, ...)
/go/src/github.vianttech.com/adelphic/mediator/vendor/github.com/aerospike/aerospike-client-go/read_command.go:170 +0x765
/go/src/github.vianttech.com/adelphic/mediator/vendor/github.com/aerospike/aerospike-client-go/read_command.go:221 +0xb46
github.com/aerospike/aerospike-client-go.(*readCommand).parseResult(0xc18a17a6e0, 0x14bf940, 0xc18a17a6e0, 0xc1adefb7c0, 0x54, 0x0)
github.com/aerospike/aerospike-client-go.(*baseCommand).executeAt(0xc18a17a6e0, 0x14bf940, 0xc18a17a6e0, 0xc000de2f00, 0xc000de2f01, 0xbfc6c00a24d2e357, 0xe503dc309a7c, 0x1bd88a0, 0x0, 0x0, ...)
/go/src/github.vianttech.com/adelphic/mediator/vendor/github.com/aerospike/aerospike-client-go/read_command.go:170 +0x765
/go/src/github.vianttech.com/adelphic/mediator/vendor/github.com/aerospike/aerospike-client-go/read_command.go:221 +0xb46
github.com/aerospike/aerospike-client-go.(*readCommand).parseResult(0xc18a17a6e0, 0x14bf940, 0xc18a17a6e0, 0xc1adefb7c0, 0x54, 0x0)
/go/src/github.vianttech.com/adelphic/mediator/vendor/github.com/aerospike/aerospike-client-go/command.go:1795 +0xda
/go/src/github.vianttech.com/adelphic/mediator/vendor/github.com/aerospike/aerospike-client-go/command.go:1920 +0x8a8
github.com/aerospike/aerospike-client-go.(*readCommand).Execute(...)
github.com/aerospike/aerospike-client-go.(*baseCommand).execute(0xc18a17a6e0, 0x14bf940, 0xc18a17a6e0, 0x1, 0x0, 0x0)
....
2020/08/17 13:39:52 exit status 2
khaf commented 4 years ago

Could you give me an idea of what's in the record, and how often do you encounter this error?

adranwit commented 4 years ago

It happens intermittently, not too frequently

The records look like the following: { "16": "3271613", "20": { "ns_dv": { "532": { "82031170": 1 } } }, "31": { "isPendingUpdate": false, "expiry": "$AsInt(${timestamp.tomorrow})", "segments": { "525": [ "404" ], "777": [ "app" ] } }

khaf commented 4 years ago

Does it happen on the same record (specific key), or just randomly?

adranwit commented 4 years ago

no sure, but I would guess it's random,

khaf commented 4 years ago

After looking at logs you have submitted, it seems like it is the same record (same key) that is causing this issue. The size values in the panics are the same. Are you also writing records to the database with a different client (C, Java, etc)? Do you think you will be able to find out which is the key causing this? If yes, do you think you will be able to check if you can retrieve that same key via aql? Also it would help if you could mention what operations are you using on the database. Read, Write, Operate, Scan/Query/UDF/Aggregation, etc.

khaf commented 3 years ago

Since I didn't hear back from you, I'll go ahead and close this ticket. Feel free to reopen it, or open and new one.