Page MenuHomeFeedback Tracker

CRASH: format["%1n", undefinedVariable]; in scheduled space with -showScriptErrors parameter
Closed, ResolvedPublic

Description

This is a pretty strange one. I've spent a few hours tracking it down to the source and I have it to a point where it crashes 100% of the time.
The command format["%1n", _undefVar] (where _undefVar is undefined) in scheduled space only will cause a Windows invoked "Arma3.exe has stopped responding". Global and local variables will both present the crash.
-showScriptErrors must be enabled.

format["%1next", _next] will crash, if _next is undefined.
format["%1n", ] will crash -just by being compiled-!

format["%1n", nil] will -not- crash, showing no errors.
format["%1", _next] will -not- crash, showing undefined var script error.
format["%1v", _next] will -not- crash, showing undefined var error.
format["%1v",, ] will -not- crash, showing invalid number in expression.
format["n%1", _undefVar] will -not- crash, showing undefined var.
format["n%1", ] will -not- crash, showing missing [.

{_next = 0; format["%1n", _next];} will -not- crash, showing no error.

I have tried changing things around, tried it in unscheduled space, tried defining the variable, removing the variable, using nil instead of a variable.

Now for the interesting bit:
The crash occurs at the end of scope, not at the offending line.
You can do all kinds of other scripting around the offending line, even bury it in pages of scripting, and all will execute without complaint until the end of the scope.

Details

Legacy ID
1984245654
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Game Crash
Steps To Reproduce

Launch Arma3 stable branch with -showScriptErrors launch parameter.
Preview any map, any mission.
Open the debug console.
Enter the following:

  • spawn { format["%1n", _undefVar]; diag_log "Crash upon scope exit";

};

Execute the code, look at your log.

Then, try this one:
crashingCode = {format["%1n", ];};

Execute the code.

Additional Information

Scheduled space only. Does not occur in unscheduled space.
Undefined or nonexistent variables only. Nil will not produce.
Crashes at the end of scope.
Produces no error of any kind in Arma, not even an undefined variable script error.
Produces no Arma log artifacts.
Vanilla, stable branch.
"%1n" appears to be a critical component.
-showScriptErrors is involved. Remove it and the crash goes away.

Multiplayer behavior is as such:
Any client that crashes in this manner will be considered by the server to be "losing connection" for 90 seconds. Attempts to rejoin the game will append a (2) to the player name and the server will then kick them.
Local servers (servers with interface), will crash.
Dedicated servers do not crash with this issue, though they will kick rejoin attempts until the original connection times out.

Event Timeline

Tiskahar edited Steps To Reproduce. (Show Details)Mar 15 2015, 7:49 PM
Tiskahar edited Additional Information. (Show Details)
Tiskahar set Category to Game Crash.
Tiskahar set Reproducibility to Always.
Tiskahar set Severity to None.
Tiskahar set Resolution to Fixed.
Tiskahar set Legacy ID to 1984245654.May 8 2016, 11:41 AM
Tiskahar edited a custom field.

confirmed

format["%1n", _undefVar] causes crash in scheduled environment

This has been fixed in rev. 129770.