swift-noise icon indicating copy to clipboard operation
swift-noise copied to clipboard

Strange crash with Fatal error: Array index is out of range

Open wilg opened this issue 3 years ago • 0 comments

I get a crash somewhat randomly when generating in a loop of tens of thousands of pixels.

Here's an example of some of the settings when it crashed. It doesn't seem to crash particularly reproducibly.

let noise = GradientNoise2D(amplitude: 1, frequency: 0.5, seed: 332)
noise.evaluate(-25.3217883662071, 43.793)

I (amazingly) cannot figure out how to copy the stack trace out of Xcode but it crashes on this line:

https://github.com/kelvin13/noise/blob/965fc23d7e95fb21a9065ef1566ee2bbd2b86e4b/sources/noise/gradient.swift#L540

with

2022-02-04 12:49:07.312857-0800 Run[53616:517701] Swift/Array.swift:405: Fatal error: Array index is out of range

wilg avatar Feb 04 '22 20:02 wilg