You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The instruction hash := murmur32.Sum32([]byte(key)) in the function func (s *SliceMap) GetBucket(key string) cmap.ConcurrentMap returns a uint32, the conversion int(hash) in 32 bit arquitecture could return a negative number, and a panic in s.LocalPIDs[index] when the index is negative.
Describe the bug
This code:
in https://github.com/asynkron/protoactor-go/blob/dev/actor/process_registry.go
cuases a panic: runtime error: index out of range [-327] when the code is compiled for 32 bit architecture
To Reproduce
Run the next code in 32 bit arquitecture
The instruction
hash := murmur32.Sum32([]byte(key))
in the functionfunc (s *SliceMap) GetBucket(key string) cmap.ConcurrentMap
returns a uint32, the conversionint(hash)
in 32 bit arquitecture could return a negative number, and a panic ins.LocalPIDs[index]
when the index is negative.Expected behavior
avoid conversion int32 from uint32 when the return is negative.
Additional context
The problem is in 32 bit Arquitecture because the built-in type int is a 32 bit data.
The text was updated successfully, but these errors were encountered: