Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Invalid memory access using Burst backend
#4
(17-02-2022, 07:24 PM)pdinklag Wrote: 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!

Hi,

Thanks for the detailed report and hints to where the issue lies! I've been so far unable to reproduce it, but at least now I know where to look. This does narrow down the bug considerably.

When disabled, colliders are moved to the end of the colliders array and the amount of active colliders is reduced by one. This really sounds like somehow an inactive collider is being accessed, but its corresponding material in the materials array is not there. Will try to reason about how this might be the case and hopefully find a fix before next week.
Reply


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