The International Simutrans Forum

 

Author Topic: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)  (Read 55097 times)

0 Members and 1 Guest are viewing this topic.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2520
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #315 on: September 14, 2018, 12:53:07 PM »
I am getting tired of losing work on this server... For every 1 hour of actual work I put in I end up having to spend 3 hours due to redoing stuff multiple times! Sigh...

This time I cannot even provide a save with all the work. It appears that you got a save made slightly before the last one I have. Which would mean the save that was corrupted is the one I have (which had only very little work done by then, easy to redo) and the server did not save after I spent some time on it.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #316 on: September 14, 2018, 01:01:43 PM »
I am sorry that there are difficulties: without being able to reproduce the error reliably, it is extremely difficult to track down what they are. It is not at all clear to me why the saved games are so regularly becoming corrupted. I am grateful for your work in relation to the memory leak investigation, which I will look into when I get some time.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 519
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #317 on: September 14, 2018, 06:18:19 PM »
If it can be of any help I have a save from last night which I at least have managed to load correctly: https://drive.google.com/file/d/19BqNZ24I_2BdHs_FQeFNUGMb9492oZbe/view?usp=sharing

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2520
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #318 on: September 15, 2018, 01:25:26 AM »
Unfortunately it is too late by now for that. I redid most of my work on the server and many other players spent hours on it.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #319 on: September 15, 2018, 05:34:26 PM »
Thanks to some very helpful diagnostic work from Dr. Supergood, I have now pushed two memory leak fixes and confirmed that at least most of the crashes are caused by running out of memory.

It will be very instructive to observe whether these issues are resolved after to-morrow's nightly build.

Offline SuperTimo

  • *
  • Posts: 33
  • Languages: English, French
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #320 on: September 16, 2018, 10:35:24 AM »
As someone from Somerset I am struggling to type the name 'Bridgewater' with the 'e' when querying the server. James can you please go back in time to the 18th century and convince the duke to change the spelling of his name to 'Bridgwater'?

Thanks in advance.

(Also Bay Transportation Group's new Class A4s are too long for some of the stops on their route so everything has ground to a halt on those lines.)
« Last Edit: September 16, 2018, 11:14:22 AM by SuperTimo »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #321 on: September 16, 2018, 01:16:57 PM »
If you could send me a time machine by post, I should happily oblige.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2520
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #322 on: September 16, 2018, 05:18:03 PM »
Could be worse... The server might be named "42726964676577617465722d4272756e656c". Now that would be hard to type!

If you are on Windows you can copy and paste the details from this thread. This is what I do when joining.

Also the extended server listing server being down is temporary. It will eventually be restored. Such is the nature of lower use base opensource "free" projects.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9286
  • Languages: De,EN,JP
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #323 on: September 18, 2018, 12:46:09 PM »
Also SDL2 on linux could copy and paste ... at least this was added recently to stadard, file "clipboard_s2.cc"

Offline SuperTimo

  • *
  • Posts: 33
  • Languages: English, French
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #324 on: September 18, 2018, 11:34:33 PM »
I think I will go bankrupt soon as I accidentally built a 22km long tunnel which has put me about £3million over my credit limit. I am not sure how this is possible as I didn't have the money for this, and I was pretty certain I was holding ctrl. Also the chances of this must have been so slim as there had to be another double height slope at the same height exactly inline!

Is it possible to get some help with this debt. I don't think railway companies in the 1930s inadvertently built > 20km long tunnels. Here is a pic of the impact on my budget:



 
« Last Edit: September 19, 2018, 12:39:31 AM by SuperTimo »

Offline ACarlotti

  • *
  • Posts: 240
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #325 on: September 19, 2018, 12:15:14 AM »
Unfortunately not all capital expenditure is checked against the credit limit - in fact coverage is pretty patchy. This ought to be improved.

Another feature that could be useful is if expensive purchases (above a threshold of perhaps 5% of wealth or some absolute value) were subject to an explicit confirmation dialogue to avoid accidentally spending large amounts of money (which would off further protection in the event that you the expensive purchase didn't exceed your credit limit).

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2520
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #326 on: September 19, 2018, 01:17:42 AM »
If you go bankrupt you can always join my company. Doubt there is a mistake big enough that can spend 500M in one go!

It seems the UI is slightly unrepsonsive due to the low frame rate the game works at. You might have pressed ctrl too soon before mouse release or released ctrl too soon after mouse release.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 519
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #327 on: September 19, 2018, 12:57:31 PM »
The double slope is created automatically.

Offline SuperTimo

  • *
  • Posts: 33
  • Languages: English, French
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #328 on: September 19, 2018, 11:51:49 PM »
I think I should be alright, I am almost back in credit, although I have an extra 30,000 in interest to pay each month now. I think the server save is corrupted again. I have tried loading it offline and it causes Simutrans to crash after loading finishes. I have a save from around 22:00 that works.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2520
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2) - FATAL ERROR
« Reply #329 on: September 20, 2018, 02:23:31 AM »
I do not think the save is corrupt, rather there is a fatal bug that manifests itself almost immediately after load. Someone will have to debug it...

Edit:
Stack trace below...
Code: [Select]
Exception thrown: read access violation.
this was nullptr.
> Simutrans-Extended Normal x64 Debug (SDL 2).exe!strasse_t::get_overtaking_mode() Line 57 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!road_vehicle_t::can_enter_tile(const grund_t * gr, int & restart_speed, unsigned char second_check_count) Line 3655 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!vehicle_t::hop_check() Line 1640 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!vehicle_base_t::do_drive(unsigned int distance) Line 372 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!convoi_t::sync_step(unsigned int delta_t) Line 1312 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!karte_t::sync_list_t::sync_step(unsigned int delta_t) Line 4661 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!karte_t::sync_step(unsigned int delta_t, bool do_sync_step, bool display) Line 4724 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!interrupt_check(const char * caller_info) Line 112 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!karte_t::step() Line 5488 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!karte_t::interactive(unsigned int quit_month) Line 10570 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!simu_main(int argc, char * * argv) Line 1384 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!sysmain(int argc, char * * argv) Line 826 C++
  Simutrans-Extended Normal x64 Debug (SDL 2).exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 793 C++
  [External Code]

In road_vehicle_t::can_enter_tile the local variable current_str is null.

I am guessing this is a bug with the overtaking patch. It probably only manifested itself now because someone actually bothered to use one of the many overtaking or direction limited road mechanics other than the default.

Code: [Select]
// When overtaking_mode changes from inverted_mode to others, no cars blocking must work as the convoi is on traffic lane. Otherwise, no_cars_blocking cannot recognize vehicles on the traffic lane of the next tile.
//next_lane = -1 does NOT mean that the vehicle must go traffic lane on the next tile.
const strasse_t* current_str = (strasse_t*)(welt->lookup(get_pos())->get_weg(road_wt)); // THIS IS NULL
if(  current_str  &&  current_str->get_overtaking_mode()==inverted_mode  ) {
if(  str->get_overtaking_mode()<inverted_mode  ) {
next_lane = -1;
}
}

if(  current_str->get_overtaking_mode()<=oneway_mode  &&  str->get_overtaking_mode()>oneway_mode  ) {
next_lane = -1;
}

The error appears to be that the second conditional test is not testing that current_str is non null like the first conditional test is. It can pass the first conditional test if NULL but will crash with a null pointer dereference with the second test.

In case someone wants to blame a person for it (joking, this would be more for interest) the details of which vehicle is causing the crash are below.
Code: [Select]
x = 6102
y = 3237
owner_n = 3
name_and_id = "(5015) Clydesdale horse (single)"
Apparently this was one of my horses! I have not touched that area of the map for decades...

Also the tile it was on was not a road? Very strange.

I tested the following fix and it appears to prevent the crash. If this does not cause other bugs I do not know.
Code: [Select]
// When overtaking_mode changes from inverted_mode to others, no cars blocking must work as the convoi is on traffic lane. Otherwise, no_cars_blocking cannot recognize vehicles on the traffic lane of the next tile.
//next_lane = -1 does NOT mean that the vehicle must go traffic lane on the next tile.
const strasse_t* current_str = (strasse_t*)(welt->lookup(get_pos())->get_weg(road_wt));
if(  current_str  ) {
const overtaking_mode_t current_overtake_mode = current_str->get_overtaking_mode();
if(  current_overtake_mode==inverted_mode  ) {
if(  str->get_overtaking_mode()<inverted_mode  ) {
next_lane = -1;
}
}

if(  current_overtake_mode<=oneway_mode  &&  str->get_overtaking_mode()>oneway_mode  ) {
next_lane = -1;
}
}
« Last Edit: September 20, 2018, 10:07:14 AM by DrSuperGood »

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2520
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #330 on: September 21, 2018, 07:15:56 AM »
This issue has been fixed in the latest nightly. Play on the server can resume.


EDIT: I seem to be having problems remaining in sync for an extended period of time.

Yeh there is 100% an OoS bug now...
« Last Edit: September 21, 2018, 07:35:59 AM by DrSuperGood »

Offline SuperTimo

  • *
  • Posts: 33
  • Languages: English, French
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #331 on: September 21, 2018, 12:54:00 PM »
Yeah normally I am losing synchronisation with the server after only 5 minutes or so.

Offline ACarlotti

  • *
  • Posts: 240
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #332 on: September 21, 2018, 02:21:48 PM »
Based upon the timing, I think the two most likely causes of the desync are either something I merged from Standard, or the change in circumstances that exposed the OTRP crash could also be exposing a OTRP desync.

A good line of investigation would probably be to see if the crash can be reproduced locally (i.e. testing with both server and client on the same computer, or otherwise avoiding the main server). If it can be reproduced, then see if it can also be reproduced (from the same savegame and actions) using a build based on commit 99c2b9. That should give a probably indication of whether it is changing code or changing circumstances that have triggered the bug. If it is a change in code that is at fault, then I'd check commit 280439 (the last commit on the merge-from-standard branch before the latest merge), and if that can reproduce the desync then try bisecting the merge-from-standard commits betwen 280439 and 48bc29.

For various reasons (lack of time, lack of computing power) I can't easily investigate this myself, but perhaps those suggestions are of some help.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2520
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #333 on: September 21, 2018, 03:01:59 PM »
Quote
A good line of investigation would probably be to see if the crash can be reproduced locally (i.e. testing with both server and client on the same computer, or otherwise avoiding the main server).
There is no crash... It just out of syncs after a while (30-300 seconds).

Did the OoS from power nets get fixed?

Another approach would be a debug functionality build which every frame forces a hash check and dumps a listing of hashes of all objects on the map every frame. When an out of sync occurs, the listing from the client and server for the same frame could be programmatically compared and the object(s) that went out of sync detected. As this happened as quickly as possible the divergence should be minimal so I would imagine only a dozen or so mismatched objects being detected.

Offline ACarlotti

  • *
  • Posts: 240
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #334 on: September 21, 2018, 08:57:08 PM »
There is no crash... It just out of syncs after a while (30-300 seconds).

Wherever I wrote 'crash', pretend I wrote 'desync'.

And your suggestion also sounds feasible.

Offline Junna

  • Devotee
  • *
  • Posts: 1079
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #335 on: September 27, 2018, 02:45:36 AM »
Yeah, it's impossible to stay connected for more than a few minutes now...

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9286
  • Languages: De,EN,JP
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #336 on: September 27, 2018, 04:40:15 AM »
Did Experimental now contain the overtaking patch? I though that was not network save.

Offline ACarlotti

  • *
  • Posts: 240
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #337 on: September 27, 2018, 08:31:06 AM »
It does, and I do remember that discussion, although I haven't yet reread it. This possibly adds another reason to consider just removing that feature and waiting for it to be done (or doing it) properly.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #338 on: September 27, 2018, 10:43:53 AM »
I have noted this issue. I will have to undertake some investigation over the week-end, including trying to find a way of testing old and new versions of the code with the same saved game (which will have to be prepared specially by being manually saved to an older version). I will note in particular the potential issue relating to the overtaking patch, and reversion will have to be considered if this is indeed the culprit and the author of that patch is not able to fix it within a reasonable time.

Has anyone noticed desync problems on other servers? It is possible that the issues on the Bridgewater-Brunel server arise as a result of the increase in road traffic owing to the era, which might well implicate the overtaking patch, although further testing would be needed to confirm this.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1307
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #339 on: September 27, 2018, 03:32:54 PM »
I don't recall any particular remaining network safety issues in the last version I looked at before the author stated they would no longer work on it - v12. Issues were more usability, code duplication, unfinished code (TODOs left), reversion to undesirable vehicle behaviours, and some features that I couldn't make work as they were described - e.g. signs for 'lane pinning'. The latter could indicate bugs of an undefined behavior sort, or simply misunderstanding of what was supposed to happen, but I couldn't match the videos that were posted...

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #340 on: September 29, 2018, 09:04:57 PM »
Please note that, although this server is still running, it is temporarily running an archived saved game for testing purposes. Changes made to this game will not be permanent. Please see this thread for details.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #341 on: October 06, 2018, 12:23:34 PM »
Due to ongoing issues with players being unable to remain in synchronisation with the server, the server is now running for testing purposes only until further notice. Progress will not be saved.