Search Issue Tracker

Duplicate

Votes

1

Found in

2017.4

2018.4

2019.2.4f1

2019.3

2020.1

2020.2

Issue ID

1229089

Regression

No

Crash on UnityEngine.AI.NavMesh:GetSettingsNameFromID when selecting Agents tab in Navigation window

AI Navigation

-

Reproduction steps:
1. Open the attached project ("1229089.zip")
2. Open Navigation window (Window -> AI -> Navigation)
3. Select "Agents" tab
4 If the crash doesn't happen on selecting the tab, press on the empty Agent Types space and try to add and remove a new agent a couple of times

Reproducible with: 2017.4.39f1, 2018.4.20f1, 2019.3.8f1, 2020.1.0b4, 2020.2.0a5

First lines of the stacktraces:
0x00007FF65B206996 (Unity) MemoryManager::GetAllocator
0x00007FF65B2028A7 (Unity) MemoryManager::Allocate
0x00007FF65B2180EC (Unity) malloc_internal
0x00007FF65A88396E (Unity) core::StringStorageDefault<char>::allocate
0x00007FF65A883AC0 (Unity) core::StringStorageDefault<char>::assign
0x00007FF65C36C854 (Unity) NavMesh_CUSTOM_GetSettingsNameFromID
0x000001DBBAEAF627 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.AI.NavMesh:GetSettingsNameFromID (int)

0x0000000140C12657 (Unity) MonoStringNewLength
0x0000000140C3A683 (Unity) scripting_string_new
0x0000000141ADDC2B (Unity) NavMesh_CUSTOM_GetSettingsNameFromID
0x0000000044176FFE (Mono JIT Code) (wrapper managed-to-native) UnityEngine.AI.NavMesh:GetSettingsNameFromID (int)

Note:
- Before the crash there's always this error thrown "The number of settings (4) is out of sync with the number of setting names (3)."

--------------------------
WORKAROUND:
The crash is caused by a discrepancy between the number of defined agent settings configurations and the number of names saved for them. We don't know yet how it became possible to produce this difference but they need to be the same in order for the editor to function properly.
To correct the issue in the project please open the file ProjectSettings\NavMeshAreas.asset in a text editor and make sure that the properties "m_Settings:" and "m_SettingNames:" have the same number of items declared under them.

Example that defines 3 configurations:
[...]
m_Settings:
- serializedVersion: 2
agentTypeID: 0
[...]
- serializedVersion: 2
agentTypeID: -1372625422
[...]
- serializedVersion: 2
agentTypeID: 1479372276
[...]
m_SettingNames:
- Humanoid
- New Agent
- Name Added to Prevent a Crash

  1. Resolution Note:

    The crash is caused by a discrepancy between the number of defined agent settings configurations and the number of names saved for them. We don't know yet how it became possible to produce this difference but they need to be the same in order for the editor to function properly.
    To correct the issue in the project please open the file ProjectSettings\NavMeshAreas.asset in a text editor and make sure that the properties "m_Settings:" and "m_SettingNames:" have the same number of items declared under them.

    Example that defines 3 configurations:
    [...]
    m_Settings:
    - serializedVersion: 2
    agentTypeID: 0
    [...]
    - serializedVersion: 2
    agentTypeID: -1372625422
    [...]
    - serializedVersion: 2
    agentTypeID: 1479372276
    [...]
    m_SettingNames:
    - Humanoid
    - New Agent
    - Name Added to Prevent a Crash

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.