Bug in ARKit or incorrectly used?

We are using ARKit in an app we are developing. When we are trying to detect a plane we get crashes like these: It does not happen every time, but maybe every 10:th time.

Can this be a bug in ARKit, or are we somehow using it wrong that occasionally triggers an exception?

Index out of range in T &re::DynamicArray<re::Optional<re::ProbeManager::ProbeSlice>>::operator[](size_t) [T = re::Optional<re::ProbeManager::ProbeSlice>]. index = 1008, maximum = 7
2022-04-28 08:02:37.994041-0700 Volumental[3334:610233] Index out of range in T &re::DynamicArray<re::Optional<re::ProbeManager::ProbeSlice>>::operator[](size_t) [T = re::Optional<re::ProbeManager::ProbeSlice>]. index = 1008, maximum = 7

This one seems to be related to the computer vision algorithms:

Thread 161 Queue : SlamEngine (serial)
#0	0x00000001c350b210 in ___lldb_unnamed_symbol65302$$AppleCV3D ()
#20	0x00000001075563b4 in _dispatch_client_callout ()
#21	0x000000010755e6fc in _dispatch_lane_serial_drain ()
#22	0x000000010755f2c4 in _dispatch_lane_invoke ()
#23	0x000000010756092c in _dispatch_workloop_invoke ()
#24	0x000000010756be20 in _dispatch_workloop_worker_thread ()
#25	0x00000001f15af0f4 in _pthread_wqthread ()
Enqueued from FeatureExtractor (Thread 154) Queue : FeatureExtractor (serial)
#0	0x0000000107557b4c in dispatch_group_async_f ()
#1	0x00000001c24cdb68 in ___lldb_unnamed_symbol23076$$AppleCV3D ()
#2	0x00000001c24d12e0 in ___
#19	0x00000001075563b4 in _dispatch_client_callout ()
#20	0x000000010755e6fc in _dispatch_lane_serial_drain ()
#21	0x000000010755f2c4 in _dispatch_lane_invoke ()
#22	0x000000010756092c in _dispatch_workloop_invoke ()
#23	0x000000010756be20 in _dispatch_workloop_worker_thread ()
#24	0x00000001f15af0f4 in _pthread_wqthread ()
#25	0x00000001f15aee94 in start_wqthread ()
Enqueued from FeatureExtractor (Thread 154) Queue : FeatureExtractor (serial)
#0	0x0000000107557b4c in dispatch_group_async_f ()
#1	0x00000001c2a9088c in ___lldb_unnamed_symbol41888$$AppleCV3D ()
#8	0x00000001075563b4 in _dispatch_client_callout ()
#9	0x000000010755e6fc in _dispatch_lane_serial_drain ()
#10	0x000000010755f2c4 in _dispatch_lane_invoke ()
#11	0x000000010756092c in _dispatch_workloop_invoke ()
#12	0x000000010756be20 in _dispatch_workloop_worker_thread ()
#13	0x00000001f15af0f4 in _pthread_wqthread ()
#14	0x00000001f15aee94 in start_wqthread ()
Enqueued from com.apple.arkit.capture (Thread 154) Queue : com.apple.arkit.capture (serial)
#0	0x0000000107557b4c in dispatch_group_async_f ()
#1	0x00000001c31e9700 in ___lldb_unnamed_symbol55636$$AppleCV3D ()
#28	0x00000001b568b5e4 in -[ARWorldTrackingTechnique processData:] ()
#29	0x00000001b568a9ec in -[ARParentTechnique processData:onTechniques:] ()
#30	0x00000001b568c664 in -[ARParentTechnique processData:] ()
#31	0x00000001b568a9ec in -[ARParentTechnique processData:onTechniques:] ()
#32	0x00000001b568c664 in -[ARParentTechnique processData:] ()
#33	0x00000001b568d500 in -[ARSession sensor:didOutputSensorData:] ()
#34	0x00000001b568ce24 in -[ARImageSensor _dispatchImageData:] ()
#35	0x00000001b56a4b9c in -[ARImageSensor dataOutputSynchronizer:didOutputSynchronizedDataCollection:] ()
#36	0x000000019f4901e0 in __74-[AVCaptureDataOutputSynchronizer _dispatchSynchronizedDataWithTimestamp:]_block_invoke ()
#37	0x00000001075546d4 in _dispatch_call_block_and_release ()
#38	0x00000001075563b4 in _dispatch_client_callout ()
#39	0x000000010755e540 in _dispatch_lane_serial_drain ()
#40	0x000000010755f2c4 in _dispatch_lane_invoke ()
#41	0x000000010756092c in _dispatch_workloop_invoke ()
#42	0x000000010756be20 in _dispatch_workloop_worker_thread ()
#43	0x00000001f15af0f4 in _pthread_wqthread ()
#44	0x00000001f15aee94 in start_wqthread ()

I can’t tell from this. For me, random crashes in ARKit seem to always trace back to improper access to the main thread. A variable getting accessed on the main that is also being changed on another thread. 99% of the time it’s fine. But occasionally it collides with itself.

Bug in ARKit or incorrectly used?
 
 
Q