Memory allocation crash
The way we generate a level in ... is by opening a scene with a mapmagic object, set a random seed and call the generate function. We've built quite a few nodes ourselves as well to handle pathfinding, path texturing, stunt object placement, and some other utilities. After the entire level is generated we spawn the player and the level begins. This means we are always only generating a single chunk.
So what happens is that after a while of playing the game will crash and the logs will always have something like this: DynamicHeapAllocator allocation probe 1 failed - Could not get memory for large allocation 33554432. Could not allocate memory: System out of memory!
Basically it is not able to allocate memory, but the system very clearly is not running out of memory. Neither the RAM or VRAM is anywhere near full. So it seems more like there's some kind of memory corruption going on that causes an access violation after a while.
To pinpoint the error I made a build that just generates levels over and over infinitely and this used to crash consistently on various computers after about 1.5 hours of generating. The interesting thing is that since I've updated to Unity 2017.2.0f3 (from 2017.1.0f3) the stresstest build crashes after about 10 minutes. This is great as it allows me to test a lot quicker if certain features are causing this.
So far I've tried to disable most MapMagic features, and even though they manage to sometimes delay the crash time, it still inevitably crashes. I've tried only generating a heightmap, a flat terrain with only textures, with- and without grass/trees/objects/multithreading. It seems as long as there are some resources being generated on the fly, the game will crash eventually. The only setup that I've managed to run without a crash is to generate a couple of levels beforehand, and simply load these levels in one by one, basically removing the procedural element of mapmagic and just loading/unloading the scenes.