PR#568 fixes several several easy-to-fix bugs - mostly uninitialized reads, use-after-frees and missing return values. This should eliminate several potential sources of desyncs, although I have not encountered any relevant ones during testing.
I have also removed the "using namespace std" from float32e8_t.h, which might break some calls to min/max, but I have not encountered any differences between the old code and the new code (tested with the "heavy mode" desync checker).
Excellent, thank you for this: now incorporated. I notice that one of the checks was a data race in the calls to await_path_explorer(); I am interested in whether this might have been the cause of the thread deadlocks that occasionally take down the online games.
I have just restarted the Bridgewater-Brunel server from such an outage, and it will be interesting to see whether this problem recurs in the near future. It will be useful to retain the current late stage game for a while to test this thoroughly.
Quote from: jamespetts on September 03, 2022, 12:24:31 PMI am interested in whether this might have been the cause of the thread deadlocks that occasionally take down the online games.
No idea - I personally have not encountered a thread deadlock so far, so I do not know what the cause might be.
Quote from: ceeac on September 03, 2022, 08:13:36 AMPR#568 fixes several several easy-to-fix bugs - mostly uninitialized reads, use-after-frees and missing return values. This should eliminate several potential sources of desyncs, although I have not encountered any relevant ones during testing.
I have also removed the "using namespace std" from float32e8_t.h, which might break some calls to min/max, but I have not encountered any differences between the old code and the new code (tested with the "heavy mode" desync checker).
Thank you for fixing these bugs, ceeac! I appreciate your kindness in using your advanced coding skills to benefit the Simutrans community.
Quote from: jamespetts on September 03, 2022, 12:24:31 PMExcellent, thank you for this: now incorporated. I notice that one of the checks was a data race in the calls to await_path_explorer(); I am interested in whether this might have been the cause of the thread deadlocks that occasionally take down the online games.
I have just restarted the Bridgewater-Brunel server from such an outage, and it will be interesting to see whether this problem recurs in the near future. It will be useful to retain the current late stage game for a while to test this thoroughly.
Both B-B and TSE have had freezes in the last week, so unfortunately I think this fix has not solved the bug. I will continue the discussion in this thread (https://forum.simutrans.com/index.php/topic,20355.0.html).
Thank you for your feedback - this is helpful (albeit the substance of it unfortunate).