WindowsPlatformCrashContext.ForceCrashReportDialogOff
WindowsPlatformCrashContext.ForceCrashReportDialogOff
#Overview
name: WindowsPlatformCrashContext.ForceCrashReportDialogOff
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, force the crash report dialog to not be displayed in the event of a crash.
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of WindowsPlatformCrashContext.ForceCrashReportDialogOff is to control the display of the crash report dialog in the event of a crash on Windows platforms. It’s primarily used in the crash reporting system of Unreal Engine.
This setting variable is relied upon by the Core module of Unreal Engine, specifically within the Windows-specific crash handling subsystem. It’s used in the WindowsPlatformCrashContext implementation.
The value of this variable is set through a console variable (CVar) system. It’s initialized as a static TAutoConsoleVariable
This variable interacts with other crash reporting logic, particularly in determining whether to show the crash report dialog. It’s used in conjunction with other conditions like unattended mode or dedicated server status to decide if the dialog should be suppressed.
Developers must be aware that setting this variable to true will force the crash report dialog to not be displayed, even in situations where it might normally appear. This could potentially hide important crash information from developers during testing or from users in production.
Best practices when using this variable include:
- Only enable it in specific scenarios where suppressing the crash dialog is absolutely necessary.
- Ensure there are alternative ways to collect crash data when this is enabled.
- Use it in conjunction with other crash reporting mechanisms to ensure no critical information is lost.
Regarding the associated variable CVarForceCrashReportDialogOff:
This is the actual console variable that controls the behavior. It’s defined within the UE::Core::Private namespace and is used to get the current value of the setting at runtime. The purpose and usage are the same as WindowsPlatformCrashContext.ForceCrashReportDialogOff, as they represent the same concept within the engine.
When using CVarForceCrashReportDialogOff, developers should be aware that it’s accessed using the GetValueOnAnyThread() method, which suggests it can be safely read from any thread. However, changing this value at runtime should be done with caution, as it could affect crash reporting behavior in unexpected ways if changed during a crash event.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Windows/WindowsPlatformCrashContext.cpp:187
Scope (from outer to inner):
file
namespace UE::Core::Private
Source code excerpt:
{
static TAutoConsoleVariable<bool> CVarForceCrashReportDialogOff(
TEXT("WindowsPlatformCrashContext.ForceCrashReportDialogOff"),
false,
TEXT("If true, force the crash report dialog to not be displayed in the event of a crash."),
ECVF_Default);
}
/**
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Windows/WindowsPlatformCrashContext.cpp:604
Scope (from outer to inner):
file
namespace anonymous
function int32 ReportCrashForMonitor
Source code excerpt:
// Determine UI settings for the crash report. Suppress the user input dialog if we're running in unattended mode
// or if it is forced of through the WindowsPlatformCrashContext.ForceCrashReportDialogOff console variable.
// Usage data controls if we want analytics in the crash report client
// Finally we cannot call some of these functions if we crash during static init, so check if they are initialized.
bool bNoDialog = ReportUI == EErrorReportUI::ReportInUnattendedMode;
bNoDialog |= UE::Core::Private::CVarForceCrashReportDialogOff.GetValueOnAnyThread() == true;
bool bSendUnattendedBugReports = true;
bool bSendUsageData = true;
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Windows/WindowsPlatformCrashContext.cpp:819
Scope (from outer to inner):
file
namespace anonymous
function int32 ReportCrashUsingCrashReportClient
Source code excerpt:
// Suppress the user input dialog if we're running in unattended mode or if it is forced of through the
// WindowsPlatformCrashContext.ForceCrashReportDialogOff console variable.
bool bNoDialog = FApp::IsUnattended() || ReportUI == EErrorReportUI::ReportInUnattendedMode || IsRunningDedicatedServer();
bNoDialog |= UE::Core::Private::CVarForceCrashReportDialogOff.GetValueOnAnyThread() == true;
bool bImplicitSend = false;
#if !UE_EDITOR
if (GConfig && ReportUI != EErrorReportUI::ReportInUnattendedMode)
#Associated Variable and Callsites
This variable is associated with another variable named CVarForceCrashReportDialogOff
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Windows/WindowsPlatformCrashContext.cpp:186
Scope (from outer to inner):
file
namespace UE::Core::Private
Source code excerpt:
namespace UE::Core::Private
{
static TAutoConsoleVariable<bool> CVarForceCrashReportDialogOff(
TEXT("WindowsPlatformCrashContext.ForceCrashReportDialogOff"),
false,
TEXT("If true, force the crash report dialog to not be displayed in the event of a crash."),
ECVF_Default);
}
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Windows/WindowsPlatformCrashContext.cpp:608
Scope (from outer to inner):
file
namespace anonymous
function int32 ReportCrashForMonitor
Source code excerpt:
// Finally we cannot call some of these functions if we crash during static init, so check if they are initialized.
bool bNoDialog = ReportUI == EErrorReportUI::ReportInUnattendedMode;
bNoDialog |= UE::Core::Private::CVarForceCrashReportDialogOff.GetValueOnAnyThread() == true;
bool bSendUnattendedBugReports = true;
bool bSendUsageData = true;
bool bCanSendCrashReport = true;
// Some projects set this value in non editor builds to automatically send error reports unattended, but display
// a plain message box in the crash report client. See CRC app code for details.
bool bImplicitSend = false;
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Windows/WindowsPlatformCrashContext.cpp:821
Scope (from outer to inner):
file
namespace anonymous
function int32 ReportCrashUsingCrashReportClient
Source code excerpt:
// WindowsPlatformCrashContext.ForceCrashReportDialogOff console variable.
bool bNoDialog = FApp::IsUnattended() || ReportUI == EErrorReportUI::ReportInUnattendedMode || IsRunningDedicatedServer();
bNoDialog |= UE::Core::Private::CVarForceCrashReportDialogOff.GetValueOnAnyThread() == true;
bool bImplicitSend = false;
#if !UE_EDITOR
if (GConfig && ReportUI != EErrorReportUI::ReportInUnattendedMode)
{
// Only check if we are in a non-editor build