Opened 3 years ago

Closed 3 years ago

#5851 closed defect (fixed)

OOS on rejoin on slightly outdated SVN

Reported by: Itms Owned by: wraitii
Priority: Release Blocker Milestone: Alpha 24
Component: Simulation Keywords:
Cc: Freagarach Patch: Phab:D3064

Description

When testing the Spidermonkey 52 upgrade (which was not rebased on latest SVN), we got an OOS on rejoin, which I could reproduce on the corresponding SVN revision r24041.

On that revision, one can reproduce it by running the attached commands.txt on the attached scenario map and running a serialization test.

The serialization test will fail on turn 814.

Attachments (3)

commands.txt (214.7 KB ) - added by Itms 3 years ago.
test_oos_ratumacos.xml (1.2 MB ) - added by Itms 3 years ago.
test_oos_ratumacos.pmp (641.2 KB ) - added by Itms 3 years ago.

Change History (5)

by Itms, 3 years ago

Attachment: commands.txt added

by Itms, 3 years ago

Attachment: test_oos_ratumacos.xml added

by Itms, 3 years ago

Attachment: test_oos_ratumacos.pmp added

comment:1 by wraitii, 3 years ago

Owner: set to wraitii
Patch: Phab:D3064

Thanks for the report, this was actually a big bug following Phab:D1918.

comment:2 by wraitii, 3 years ago

Resolution: fixed
Status: newclosed

In 24142:

Fix UpdateComponents logic for pathfinding following rP22902

Following rP22902, paths requested at turn N were set-up to be computed between the end of turn N and the start of turn N+1 (which would ultimately allow threading this computation), via calls to 'StartProcessingMoves' and 'FetchAsyncResultsAndSendMessages'.

However, the call to UpdateGrid() remained at the start of turn N+1, between the 'start' and 'fetch' calls. Since all paths are currently computed on the 'start' call, this means all paths are computed on a (possibly) dirty pathfinder grid.
In particular, this leads to OOS on rejoin since the rejoiner will recompute the grid before computing the outstanding paths.

This would also obviously be buggy in a threaded environment, since some paths might be computed on the fresh and some on the dirty grid.

Finally, MT_TurnStart was sent before the paths were computed, which might lead to further pathfinder grid changes (not a crashing problem without threading, but still conceptually odd). The 'fetch' call is thus moved before it.
This thus fixes rP22902/D1918, after rP22979 already fixed a first issue.

Since the grid is now only updated at the end of a turn, we need to ensure that it is correct on Turn 0, thus the pathfinder recomputes it on InitGame.

Refs D14

Reported by: Itms

Fixes #5851

Differential Revision: https://code.wildfiregames.com/D3064

Note: See TracTickets for help on using tickets.