Description

Shipping builds of the Engine fail when using the Visual Studio 2017 compiler due to a potential divide by 0 error. This is because the TotalColumnSize property of SMemoryStats is set to 0 by default, and it appears that it is only ever changed from that value in non-Shipping or non-Test builds.

REGRESSION:
No. This code does not appear to have changed since 4.13. However, the build error only appears when compiling with version 15.3+ of Visual Studio 2017.

Steps to Reproduce

SETUP:
This requires that the Visual Studio 2017 compiler be used. To make sure the correct compiler is used, open the Engine's BuildConfiguration.xml file and add the following lines inside the Configuration tags:

<WindowsPlatform>
	<Compiler>VisualStudio2017</Compiler>
</WindowsPlatform>

REPRO:

  1. Create a new Basic Code project.
  2. Navigate to the project's Config folder in the root directory (not the Saved\Config folder).
  3. If it is not already present, add a new text file named DefaultEditorPerProjectUserSettings.ini.
  4. Open the DefaultEditorPerProjectUserSettings.ini file and add the following lines:
    [/Script/SourceCodeAccess.SourceCodeAccessSettings]
    PreferredAccessor=VisualStudio2017
    
  5. Return to the root project directory.
  6. Right-click on the .uproject file and select the "Generate Visual Studio project files" option.
  7. Open the project's solution in Visual Studio 2017.
  8. Build the project using the Development Editor solution configuration.
    • The project builds successfully.
  9. Build the project using the Shipping solution configuration.

RESULT:
The build fails with the following error: engine\source\runtime\renderer\private\postprocess\rendertargetpool.cpp(985): error C4723: potential divide by 0

EXPECTED:
The build completes successfully.

Have Comments or More Details?

Head over to the existingAnswerHub thread and let us know what's up.

3
Login to Vote

Fixed
ComponentRendering
Affects Versions4.17.24.184.19
Target Fix4.18
Fix Commit3672305
Release Commit3672305
CreatedSep 29, 2017
ResolvedSep 29, 2017
UpdatedApr 27, 2018