Crash on UE4Editor-Navmesh.dll

Reproduced with:

  • Visual Studio 2017(15.5.1)
  • UE 4.18.1-release
  • Development Editor, Win64

I've built UE by myself without any problem,

but if I try to cook a sample project it crashes on:
  • UnrealEngine\Engine\Source\Runtime\Navmesh\Private\Detour\DetourNavMesh.cpp: line 1278

I debugged it and found out the cause of crash:

  • The compiler does wrong at conversion from int to uint64.

My current workaround is,

in UnrealEngine\Engine\Source\Runtime\Navmesh\Public\Detour\DetourAlloc.h, line 178 and 183:

UE 4.18.1-release official:

inline T& operator[](int i) { return m_data[i]; }

My custom fix:

inline T& operator[](unsigned int i) { return m_data[i]; }

Is there any better solution for this?

I can confirm that the workaround also works in UE 4.17.2 with VS 15.5.1.

Probably the same problem as in https://answers.unrealengine.com/questions/734371/recast-navmesh-crash.html

great job Kyeongho!

I patched my engine from your solution.
Then I could avoid clashing! :slight_smile:

I think the perfect solution of this issue that remove all embedded integer types (ex. unsignd int)from engine code.
Then rewirte code with ue4 coding standard types(ex uint32).

thanks.

We’re looking into this internally at Epic and we are able to reproduce. This appears to be a bug in the visual studio compiler update included in 15.5 and we are investigating possible solutions.

We have confirmed this is a bug on Microsoft’s side and they are working to fix it in the next update of Visual Studio 2017. In the meantime your two options are to install the visual studio 2015 toolset and use that (http://landinghub.visualstudio.com/visual-cpp-build-tools) or to install an older version of the 2017 compiler toolset and force it to use that (Side-by-side minor version MSVC toolsets in Visual Studio 2017 - C++ Team Blog). If you have both 2015 and 2017 installed it will use the 2017 IDE but the 2015 compiler, which works fine.

Hi Kyeongho,

I’m a developer on the Microsoft C++ compiler team. Per the discussion in this thread, your issue looks the same one tracked by the following link. But as I don’t see a standalone repro from your report, I can’t help confirm on my end. Please don’t hesitate to share if you have one. FYI, we will release the bug fix of the following issue in VS2017 15.6 Preview 2 and VS 2017 15.5.3.

Also, for future reference, I encourage you to report any suspected compiler issue through on the following website which we are actively monitoring.

Thanks,

Rui Zhang

Microsoft Visual C++ Team

Good to see the fix with Visual Studio 2017 15.5.3 and 15.6 .

Thank you for this!

The second link does not work, you have some extra characters on the end of it …

Kyeongho Park thank you for investigating and fixing this. I encountered this today after switching from VS2015 to VS2017 and your post saved me a lot of time.

I verified this issue is not reproduced any more with VS 2017 15.5.3 .

I verified this issue is not reproduced any more with VS 2017 15.5.3 .

Thanks for the confirmation. It’s great to know the issue is resolved.

Thanks,
Rui Zhang
Microsoft Visual C++ Team

By chance has this issue returned in 4.19.2 with latest vs2017? 15.7.6

This happened after updating my project to 4.19.2 from 4.18.3. My game packages without issue on 4.18.3 but gets crashes on map load in 4.19.2. I’ve removed the landscape and AI from the game figuring maybe something was causing the navigation generation to error. Currently I’m going through the map trying to eliminate mesh objects from the nav mesh bounds hoping I can find a needle in a haystack (bad mesh) that might be causing it.

FOUND IT!!! The SEDAN TEST VEHICLE in a navmesh in 4.19.2 causes this.