Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Invalid memory access using Burst backend
#3
As mentioned in the corresponding thread regarding libOni, I decided to switch back to Burst in the hope to be able to debug this somehow using the source code.
Luckily, this was as easy as commenting the BurstCompile attribute for IdentifyMovingColliders and provoke the crash in the Editor (which I still don't know how to do deterministically, but least I got the means to make it happen within few minutes).

I got it down to this (Obi 6.4):
Code:
IndexOutOfRangeException: Index 0 is out of range of '0' Length.
Unity.Collections.NativeArray`1[T].FailOutOfRangeError (System.Int32 index) (at <ad50157ee00e45cdb3c8bd67012f8804>:0)
Unity.Collections.NativeArray`1[T].CheckElementReadAccess (System.Int32 index) (at <ad50157ee00e45cdb3c8bd67012f8804>:0)
Unity.Collections.NativeArray`1[T].get_Item (System.Int32 index) (at <ad50157ee00e45cdb3c8bd67012f8804>:0)
Obi.BurstColliderWorld+IdentifyMovingColliders.Execute (System.Int32 i) (at Assets/Plugins/Obi/Scripts/Common/Backends/Burst/Collisions/BurstColliderWorld.cs:154)
Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[T].Execute (T& jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <ad50157ee00e45cdb3c8bd67012f8804>:0)
Unity.Jobs.JobHandle:ScheduleBatchedJobsAndComplete(JobHandle&)
Unity.Jobs.JobHandle:Complete()
Obi.BurstColliderWorld:UpdateWorld(Single) (at Assets/Plugins/Obi/Scripts/Common/Backends/Burst/Collisions/BurstColliderWorld.cs:117)
Obi.ObiColliderWorld:UpdateWorld(Single) (at Assets/Plugins/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:397)
Obi.ObiUpdater:BeginStep(Single) (at Assets/Plugins/Obi/Scripts/Common/Updaters/ObiUpdater.cs:56)
Obi.ObiFixedUpdater:FixedUpdate() (at Assets/Plugins/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:46)

Looks like it's trying to access collisionMaterials at index 0 when the array is empty. Indeed, it seems as though it's always empty.

I'm not sure what to make of this, and I can't find any code that constructs a BurstColliderShape so I can't find out what's slipping a 0 as its materialIndex.
But I hope this helps!
Reply


Messages In This Thread
RE: Invalid memory access using Burst backend - by pdinklag - 17-02-2022, 07:24 PM