Access Violation in Camera.Render() when called multiple times in succession
Hello,
I am having strange problem after upgrade to Unity 2018.2 (replicated on 2018.2.6 and 2018.2.5) that I'm having trouble to isolate. The game randomly crashes in particular scenes. It occurs when my script renders a custom cubemap (which involves calling Camera.Render() 6 times in succession with texture copy (using Graphics.CopyTexture()) and positioning operations in between) within UnityPlayer.dll's code. This didn't occur in 2018.1.x versions.
I haven't found out what about the scene causes this crash yet, so I haven't managed to isolate it into a small reproducible project.
It seems like a possible race condition, placing Thread.Sleep(x) calls between the Camera.Render() calls decreases the likelihood of crash on each render, but doesn't eliminate it altogether. It doesn't seem to occur in the Editor at all.
Here's the crash dump with error log file and the stack trace (includes UnityPlayer's PDB symbols).
Any help would be appreciated, even to help isolate the issue.