I keep getting this error on logcat from my Android build, made with Unity 6000.0.58f2, IL2CPP, running on a Samsung Galaxy S21 Ultra, Pathfinding v5.4.5, in the project i use only the RVO setup:
Error Unity Invalid memory pointer was detected in ThreadsafeLinearAllocator::Deallocate!
i’m not entirely sure if it’s related to the asset, but this is the answer i got from copilot which lead me here:
Short answer: the crash is likely caused by unsafe/freeing code in the Pathfinding (Aron Granberg A*) package — not StageManager. The log message “ThreadsafeLinearAllocator::Deallocate!” points to a native allocator deallocation error (double-free or allocator mismatch). In this project the low-level frees happen in these places:
• Packages/com.arongranberg.astar/Core/Collections/Span.cs — UnsafeSpan.Free / MoveToNativeArray (calls UnsafeUtility.FreeTracked / ConvertExistingDataToNativeArray)
• Packages/com.arongranberg.astar/Core/Collections/SlabAllocator.cs — SlabAllocator.Dispose / Free (calls AllocatorManager.Free)
• Packages/com.arongranberg.astar/Utilities/JobDependencyTracker.cs → DisposeArena.DisposeAll — calls AllocatorManager.Free and UnsafeUtility.FreeTracked for tracked pointers
Why this is the likely source
• The A* package performs manual allocation/freeing (UnsafeSpan, SlabAllocator, AllocatorManager.Free, UnsafeUtility.FreeTracked). The Unity error indicates a native allocator deallocation problem — exactly what happens when those methods are used incorrectly (freeing a pointer twice, freeing with the wrong allocator, or freeing memory that was already transferred to another owner).
• Your StageManager and game code use only managed memory and Unity APIs (no direct AllocatorManager/UnsafeUtility frees), so they are unlikely to directly trigger that native error.