The International Simutrans Forum

 

Author Topic: Online checklist mismatches (was: Clients keep disconnecting)  (Read 7893 times)

0 Members and 1 Guest are viewing this topic.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1326
Re: Online checklist mismatches (was: Clients keep disconnecting)
« Reply #35 on: January 24, 2016, 06:16:59 PM »
Thanks for pursuing. It's nice to get beyond the 'it's just me' phase...
waitlock issue? I've noticed trains getting stuck in the 'schedule changing' mode quite often. Seems if their associated line schedule is changed while they're in a station loading they get stuck for an extended time.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4603
  • Languages: EN, DE, AT
Re: Online checklist mismatches (was: Clients keep disconnecting)
« Reply #36 on: January 24, 2016, 06:42:15 PM »
It appears that r7731 (and then r7742) indeed fixed this desync by accident.

There was a train with route_index == route.get_count(), which called the block_reserver in can_enter_tile due to next_block+1<route_index. However, block_reserver immediately returned false, which was ignored, then cnv->set_next_stop_index was called, but next_signal and next_crossing were not assigned in block_reserver -> undefined value propagating.

valgrind would have found this, but I could not get to run it on my machine, the savegame was just too heavy.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1326
Re: Online checklist mismatches (was: Clients keep disconnecting)
« Reply #37 on: January 25, 2016, 12:00:05 AM »
That's great news then.
Is your desync-debugging code something in a shareable state?

Isn't a train with route_index==route.get_count() calling the block_reserver an error in the first place?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4603
  • Languages: EN, DE, AT
Re: Online checklist mismatches (was: Clients keep disconnecting)
« Reply #38 on: January 25, 2016, 08:09:15 AM »
I will upload a patch in the evening.

Isn't a train with route_index==route.get_count() calling the block_reserver an error in the first place?
Don't know. That would need further investigation.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4603
  • Languages: EN, DE, AT
Re: Online checklist mismatches (was: Clients keep disconnecting)
« Reply #39 on: January 25, 2016, 09:05:08 PM »
Here is a patch for debugging desyncs. Both client and server have to be compiled with the patch enabled (-DDEBUG_DESYNC, there are also new files network/network_debug.*).

Upon desync, client and server exchange data (like calls to simrand etc). The first difference found will be reported in a new window inside the client and written to desync.log.

With
Code: [Select]
network_debug_add(format, ....)
new debug messages can be added (both on client and server) with a printf-like syntax. These message strings make up the data that is automatically compared. Usually several runs of adding debug messages & running until desync are necessary. I was lucky that the desync did not went away while adding the debug code.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9568
  • Languages: De,EN,JP
Re: Online checklist mismatches (was: Clients keep disconnecting)
« Reply #40 on: January 25, 2016, 11:55:58 PM »
I think this woulb be a very useful addition. On might rather call it NETWORK_DBG() to be in place with the "normal" DEBUG_DBG(). Then it can be always there but only does something on real network debug build.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1326
Re: Online checklist mismatches (was: Clients keep disconnecting)
« Reply #41 on: January 26, 2016, 01:16:21 AM »
That's a very nice debugging tool. Hopefully never needed again!

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3659
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Online checklist mismatches (was: Clients keep disconnecting)
« Reply #42 on: January 26, 2016, 01:59:33 AM »
Hopefully never needed again!

I know you already qualified it with "hopefully", but that still sounds like famous last words. :D