How to SCNView Renderer crash on LiDAR devices?

On the iPad Pro and iPhone 12, we are experiencing spontaneous crashing on the scenekit.scnview-renderer thread when using mesh data collected from the LiDAR sensor. It will usually appear as a EXC-BAD-ACCESS on platform-memmove or process-trianglerange-mask in the call stack.

Is there any way to prevent this crash from occurring?
Answered by arthurfromberlin in 655717022
This might be related to a bug in current Xcode versions regarding GPU Frame capture.

In Xcode go to your current scheme -> select »Edit Scheme…« -> Run/Options: set »GPU Frame Capture« to Disabled.
If this does not help try deactivating »Metal API validation« in the Diagnostics tab.

Not ideal, but at least somewhat of a workaround for the time being.
Accepted Answer
This might be related to a bug in current Xcode versions regarding GPU Frame capture.

In Xcode go to your current scheme -> select »Edit Scheme…« -> Run/Options: set »GPU Frame Capture« to Disabled.
If this does not help try deactivating »Metal API validation« in the Diagnostics tab.

Not ideal, but at least somewhat of a workaround for the time being.
Even with suggested fixes, it appears that this issue is still persistent. A ProcessTriangleRange_Mask crash is occurring sporadically when using the SCNView function hitTest(). Any further suggestions would be appreciated!
How to SCNView Renderer crash on LiDAR devices?
 
 
Q