RandN icon indicating copy to clipboard operation
RandN copied to clipboard

IndexOutOfRangeException when calling RandN.Rngs.ChaCha.NextUInt32()

Open mizrachiran opened this issue 2 years ago • 2 comments

Hi,

I get the following exception from time to time, now sure what is the root cause.

this is how i intantiate my _rng instance: var rng = ChaCha.GetChaCha8Factory().Create(ThreadLocalRng.Instance); I call the following method: rng.NextUInt32()

Stack trace: Exception has occurred: CLR/System.IndexOutOfRangeException Exception thrown: 'System.IndexOutOfRangeException' in RandN.Core.dll: 'Index was outside the bounds of the array.' at RandN.Implementation.BlockBuffer32`2.NextUInt32() at RandN.Rngs.ChaCha.NextUInt32()

mizrachiran avatar Nov 17 '23 18:11 mizrachiran

I haven't been able to replicate this. Can you provide the .NET version, RandN version, and CPU architecture this is occurring on?

ociaw avatar Dec 09 '23 22:12 ociaw

It happened in a .net core asp app, running on Macbook pro M1. Don't have a repro, already changed my implementation.

mizrachiran avatar Dec 19 '23 16:12 mizrachiran