The rng assignment inside the closure was actually reassigning the local rng,
which would then occaisionally segfault, because RandomDevice is immutable,
so there's nothing that actually rooted it to the device object.
Side note: Somebody should probably add assertions that the various things
we're trying to protect by rooting them in the context object are actually mutable.
However, I've spent too much time on this already so I'll leave that to somebody else ;).
The
rng
assignment inside the closure was actually reassigning the localrng
, which would then occaisionally segfault, becauseRandomDevice
is immutable, so there's nothing that actually rooted it to the device object.Side note: Somebody should probably add assertions that the various things we're trying to protect by rooting them in the context object are actually mutable. However, I've spent too much time on this already so I'll leave that to somebody else ;).