Prerequisites
Game Version
Bug Description
In builds with DEBUG_CRASHING, the -ignoreAsserts command-line option is parsed only after the global GameData INIs have been loaded.
-ignoreAsserts currently belongs to paramsForEngineInit. However, GameEngine::init() loads:
Data\INI\Default\GameData
Data\INI\GameData
Data\INI\GameDataDebug in Debug builds
before calling CommandLine::parseCommandLineForEngineInit().
Consequently, a malformed GameData INI can display assertion dialogs even when the game was explicitly launched with -ignoreAsserts.
The same ordering problem affects -ignoreStackTrace: stack traces generated while loading these INIs cannot be suppressed because that option has not yet been parsed.
Reproduction Steps
- Build Zero Hour with
DEBUG_CRASHING.
- Put an invalid value in a loose
Data\INI\GameData.ini, for example:
- Run the game in non-headless mode with:
-ignoreAsserts -ignoreStackTrace
- Observe assertion handling and stack-trace generation while
GameData.ini is parsed, before the command-line options take effect.
Expected Behavior
-ignoreAsserts and -ignoreStackTrace should take effect before any GameData INIs are loaded.
This only concerns DEBUG_CRASH assertion handling. A later fatal ReleaseCrash dialog caused by the propagated INI exception is separate and is not expected to be suppressed by these options.
Suggested Fix
Move the following guarded entries from paramsForEngineInit to paramsForStartup:
#ifdef DEBUG_CRASHING
{ "-ignoreAsserts", parseIgnoreAsserts },
#endif
#ifdef DEBUG_STACKTRACE
{ "-ignoreStackTrace", parseIgnoreStackTrace },
#endif
Startup parsing already creates TheWritableGlobalData, and both handlers only set boolean members. GlobalData::init() does not reset these flags, and they are not overwritten by GameData INI fields.
The comment describing paramsForEngineInit should also be corrected: these parameters are parsed after the global GameData INIs, not before all INI data is loaded.
Prerequisites
Game Version
Bug Description
In builds with
DEBUG_CRASHING, the-ignoreAssertscommand-line option is parsed only after the global GameData INIs have been loaded.-ignoreAssertscurrently belongs toparamsForEngineInit. However,GameEngine::init()loads:Data\INI\Default\GameDataData\INI\GameDataData\INI\GameDataDebugin Debug buildsbefore calling
CommandLine::parseCommandLineForEngineInit().Consequently, a malformed GameData INI can display assertion dialogs even when the game was explicitly launched with
-ignoreAsserts.The same ordering problem affects
-ignoreStackTrace: stack traces generated while loading these INIs cannot be suppressed because that option has not yet been parsed.Reproduction Steps
DEBUG_CRASHING.Data\INI\GameData.ini, for example:UseTrees = MaybeGameData.iniis parsed, before the command-line options take effect.Expected Behavior
-ignoreAssertsand-ignoreStackTraceshould take effect before any GameData INIs are loaded.This only concerns
DEBUG_CRASHassertion handling. A later fatalReleaseCrashdialog caused by the propagated INI exception is separate and is not expected to be suppressed by these options.Suggested Fix
Move the following guarded entries from
paramsForEngineInittoparamsForStartup:Startup parsing already creates
TheWritableGlobalData, and both handlers only set boolean members.GlobalData::init()does not reset these flags, and they are not overwritten by GameData INI fields.The comment describing
paramsForEngineInitshould also be corrected: these parameters are parsed after the global GameData INIs, not before all INI data is loaded.