Description

Using incorrect formatting in FText does not cause compilation errors in EnsureMsgf as it does in other functions such as UE_LOG. This causes crashes to sneak through such as a crash on ensure when in a shipping build if using %s for an FName variable.

Regression?: No
This happens in 4.17 and was reported in 4.13

Steps to Reproduce
  1. Create a code project and add a new C++ class based off of Actor
  2. In the begin play function, add the following code:
    FName hello("hello");
    	ensureMsgf(false, TEXT("I will compile and crash at runtime %s"), hello);
  3. Compile the project
    Result: Compilation completes successfully
    Expected: Compilation fails due to %s being used for an FName

To continue and reproduce the crash (A source build is required to edit the necessary files)

  1. Change USE_CHECKS_IN_SHIPPING in Build.h and bUseChecksInShipping in TargetRules.cs to 1 and true, respectively.
  2. Compile the changes
  3. Package the project for Shipping
  4. Launched the packaged game
    Result: The game crashes on launch
    Expected: You don't get this far as the compilation from the earlier steps fails.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-55681 in the post.

0
Login to Vote

Fixed
ComponentUE - Foundation - Core
Affects Versions4.134.174.184.194.20
Target Fix4.20
Fix Commit3921587
Main Commit4034515
Release Commit4095966
CreatedMar 1, 2018
ResolvedMar 2, 2018
UpdatedMay 31, 2018
View Jira Issue