Page MenuHomeFeedback Tracker

Crash during game load with Advanced Developer Tools addon
Closed, ResolvedPublic

Description

Dedmen — 22/11/2021
oof it indeeed crashed in script evaluator

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General
Steps To Reproduce

Event Timeline

This comment was removed by nspscholarship.
dedmen claimed this task.Dec 3 2021, 10:04 AM
dedmen changed the task status from New to Assigned.
dedmen set Ref Ticket to AIII-54819.

So I noticed that this crash occurs due to Arma saving some stuff that it shouldn't.
Maybe because I store displays into global variables, and it tries to deserialize those global vars.

The script code of the crashing script instruction is uiSleep 0.5; continue
I think it might be a problem in the continue command call.

dedmen added a comment.EditedFeb 9 2022, 11:08 AM

You have this while loop

	private _currentTab = (_window getVariable ["DBUG_currentTab", controlNull]);
	private _editorText = ctrlText _editor;
	private _currentPath = _currentTab getVariable ["DBUG_params", []] param [13, ""];
	
	if (_editorText isEqualTo _lastEditorText) then {uiSleep 0.5; continue};

Now. Because you are loading from a saved game, the while loop script actually is not referencing a script file. Each item on the script callstack has been deserialized and is stand-alone, disconnected from the overall script file it once came from.
When deserializing, the scripts are stored as string, until they are called first time, then they are compiled.

Usually in a script you'd have for example a while scope, with a then scope inside it. The while has a referece to its script, the while script has a reference to the then and the then-script.
So the topmost callstack item always forms a reference chain to the bottom-most item, so while the topmost is in memory, the ones below it will never go away.

But, not when loaded from savegame where each piece (at the start) is deserialized by itself. The while contains the script below it, but only as a uncompiled string, and it doesn't have any references to the script that is in the next callstack item.

When continue walks up to the while, it cleans up everything below the while.

Now, because that script is standalone and not referenced anywhere else (the while script is actually not even compiled at this point), when we clean up the stack below the while, we are deleting the then-script. We are deleting the script that contains the instruction we are currently executing.

dedmen changed the task status from Assigned to Feedback.Feb 9 2022, 12:52 PM

Profiling v8, next week devbranch, next week RC 2.08

veteran29 closed this task as Resolved.Jun 11 2024, 4:04 PM