UnsafeList hard crashes sometimes on Dispose / Destroy

So, I’ve tried running -debugallocator (from advice in this post ), seems like this could be caused by domain code, and memory corruption is actually in a different place.

Got this instead:

NullReferenceException: Object reference not set to an instance of an object
System.Buffer.memcpy4 (System.Byte* dest, System.Byte* src, System.Int32 size) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Buffer.Memcpy (System.Byte* dest, System.Byte* src, System.Int32 size) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.String.memcpy (System.Byte* dest, System.Byte* src, System.Int32 size) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
Unity.Collections.LowLevel.Unsafe.UnsafeUtility.WriteArrayElement[T] (System.Void* destination, System.Int32 index, T value) (at <42a5878ce129403083acccf18e43363f>:0)

Which points to this line:

UnsafeUtility.WriteArrayElement(_elements -> Ptr, node.FirstChildIndex + node.Count, element);

No clue why it happens though, need to figure it out.