y0014984 / Advanced-Equipment

Advanced Equipment is a Arma 3 mod, that brings equipment to life, like laptops and lamps.
Other
23 stars 9 forks source link

armaOS/Terminal crash #390

Open y0014984 opened 11 months ago

y0014984 commented 11 months ago

Happened on the Clear Skies event at Gruppe Adler. We have two separate video recordings and the server and client rpt file. After interaction with the terminal an script error occured, see screenshot. After that some of the ACE3 interactions wheren't available anymore, especially turn on/off/standby and accessing armaOS.

In combination with that the UI on texture feature resulted in a flickering display. Not sure if this is related to the error.

As a fallback I will introduce a "copy computer" function that allows to transfer the relevant variables from one computer to another. This could help in such situations or for debugging purposes.

additional measures:

20230814205940_1

Not sure if this error is related to that bug but it showed up at the same time in the mission 20230814211843_1

Andx667 commented 11 months ago

for clarificaton: the 2nd error about the missing paa appeared after someone accessed the 2nd laptop, which was spawned in by the zeus, not at the same time as the other error.

y0014984 commented 11 months ago

Hi @JulesVerner I solved this issue in PR #391 The following was the root cause of this issue preventing us from opening the terminal (a race condition):

  1. In the terminal, because of long outputs of file contents and commands, a lot of data was stored in the terminal output cache
  2. As @Andx667 tried to open the armaOS terminal once more, the getRemoteVar function took a long time to get very big variables from the server
  3. while waiting in the terminal init script for the data, the terminal window was blank
  4. @Andx667 closed the window in that state, because he thought that nothing will happen (I would have done that too)
  5. closing the window caused the destruction of some ui variables that were needed by the terminal init script to create some event handlers
  6. one of the event handlers is the unload event handler for the closing event of the window
  7. so @Andx667 closed the window before the unload event handler was created and fired
  8. this event hanler contains code that deletes a Mutex variable that usually indicates if the computer is currently used by a player
  9. because this variable was not deleted, the conditions of the ACE3 interactions thought that the computer is currently in use and prevented the player from opening up the terminal again

To sum it all up: The text outputs were very long causing waiting time and creating a race condition that prevents the player from opening up the terminal again. If I had enough time while the event I probably could have fixed that easily (by deleting the mutex variable) but that's how life goes.

I fixed the problem by changing the execution order. All the data is now transfered from server to client before the dialog shows up. This could take some time (there is now a hint that says "please be patient")

An additional fix will be the cropping of the terminal output cache so it can't grow that big. Perhaps 100 lines would be sufficient.