Search Issue Tracker

Won't Fix

Votes

2

Found in

2022.3.4f1

2023.1.3f1

2023.2.0a22

Issue ID

UUM-41433

Regression

No

Crash on NavMeshWorld_CUSTOM_AddDependencyInternal_Injected when entering and exiting Play Mode

--

-

Reproduction steps:
1. Open the attached “repro-project“
2. Open the Assets/Samples/Agents Navigation/3.1.6/Zerg/Zerg.unity scene
3. Enter Play Mode
4. Exit Play Mode
5. Observe the crash

Reproducible with: 2022.3.4f1, 2023.1.3f1. 2023.2.0a22
Could not test with: 2021.3.28f1 (could not downgrade the project)

Reproduced on: Windows 10 Pro

Note: If the Editor does not crash after performing the steps repeat steps 3 and 4 until it does.

First few lines of the stack trace:
{{0x00007ff705567b72 (Unity) NavMeshWorld_CUSTOM_AddDependencyInternal_Injected }}
{{0x0000021564323f65 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.Experimental.AI.NavMeshWorld:AddDependencyInternal_Injected (intptr,Unity.Jobs.JobHandle&) }}
{{0x0000021564323e83 (Mono JIT Code) UnityEngine.Experimental.AI.NavMeshWorld:AddDependencyInternal (intptr,Unity.Jobs.JobHandle) }}
{{0x0000021564323dd3 (Mono JIT Code) UnityEngine.Experimental.AI.NavMeshWorld:AddDependency (Unity.Jobs.JobHandle) }}
{{0x0000021564322c3b (Mono JIT Code) ProjectDawn.Navigation.NavMeshQuerySystem:OnUpdate (Unity.Entities.SystemState&) (at ./Packages/com.projectdawn.navigation/ProjectDawn.Navigation/NavMeshQuery/NavMeshQuerySystem.cs:157) }}

  1. Resolution Note:

    Thank you for bringing this issue to our attention. Unfortunately, after careful consideration, we will not be addressing your issue at this time, as we are currently committed to resolving other higher-priority issues. Our priority levels are determined by factors such as the severity and frequency of an issue and the number of users affected by it.
    With our recent delivery of the AI Navigation package, our focus is now on ensuring compatibility with the new animation system. However, we know each case is different, so do please continue to log any issues you find, as well as provide general feedback on our roadmap page to help us prioritize.
    Forum announcement https://forum.unity.com/threads/animation-status-update-q2-2023.1445425/
    Roadmap https://unity.com/roadmap/unity-platform/navigation-game-ai

    This API was experimental and is officially deprecated in versions of Unity starting with 2023.2.

Comments (1)

  1. adriant

    Jul 21, 2023 09:36

    This crash happens because a game script is using a NavMeshWorld instance after all the data of the navigation system has been completely destroyed.

    To avoid this crash, before we can provide a fix, make sure to not use existing instances of NavMeshWorld and NavMeshQuery after the navigation system has been destroyed through the means of either a call to NavMesh.RemoveAllNavMeshData() or by exiting playmode. Any jobs, scheduled by the game scripts, that use the NavMeshQuery or NavMeshWorld instances need to either finish before the navigation system is removed, or somehow check in their running code that the destroy operations haven't happened.

    Do not rely on the NavMeshWorld.IsValid() method in this specific case because it does not yet handle the destruction of the system as it should.

    Whenever the Navigation system restarts and re-initializes its data (e.g. by loading or creating NavMeshes, or other such operations) you need to create new NavMeshQuery instances and obtain the new NavMeshWorld instance that NavMeshWorld.GetDefaultWorld() returns.

    Please note that the NavMeshQuery and the related structs and enums have been deprecated starting with 2023.2.0a22 and will be removed in versions coming after 2023 LTS.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.