News:

SimuTranslator
Make Simutrans speak your language.

[Fix] Crashes when desynchronising from a server in some cases

Started by jamespetts, September 30, 2017, 10:20:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

I have recently found and fixed on Extended recently a crash bug that occurs in identical code to Standard: see here for the Github commit. The solution is quite straightforward, as will be apparent from the commit.

The bug involves a double free of the "nwc" object when a connecting client disconnects from a server. The fix checks whether the first delete operation has occurred and makes the second delete operation conditional on that check.

I vaguely remember this being reported as having been an intermittent problem for some time. It only affects clients, not servers.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Dwachs

thanks for the post! This could have been fixed also by removing the 'delete nwc' in do_network_world_command?
Parsley, sage, rosemary, and maggikraut.

jamespetts

I am not sure - might this not have lead to a memory leak if necessary was not deleted elsewhere? I am not sure what the purpose of this was.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Dwachs

Parsley, sage, rosemary, and maggikraut.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Dwachs

Parsley, sage, rosemary, and maggikraut.