Author Topic: Segmentation fault report: multi-threading in Network game  (Read 963 times)

0 Members and 1 Guest are viewing this topic.

Offline Phystam jp

  • *
  • Posts: 88
  • (=*^ω^*=)
  • Languages: JP, EN
Segmentation fault report: multi-threading in Network game
« on: March 15, 2018, 09:09:46 AM »
Hi! I report the critical bug in network game.

Currently we are playing the game using network. However we faced on segmentation fault troubles.
GDB says the segmentation fault occurred in simware.h at the line of 4808 (around freight section), and this troubles appear frequently: almost within 1 minute since establishing connection.
This troubles are only seen with windows and mac, but using linux (ubuntu14.04LTS 64bit and scientific linux 6 32bit), the trouble cannot be seen. It is very odd behaviour.
And also, when we switched into single-thread version from multi-thread version, the troubles would not appear completely.

I will report the detail of trace back later.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17194
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Segmentation fault report: multi-threading in Network game
« Reply #1 on: March 15, 2018, 10:40:22 AM »
Thank you for the report. A backtrace would certainly be helpful. If you can upload a saved game in which this can be reproduced on a Windows machine, this would be even more helpful, as a backtrace may well not be enough by itself for me to identify the problem clearly.
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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17194
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Segmentation fault report: multi-threading in Network game
« Reply #2 on: May 04, 2018, 10:50:53 PM »
Can I check whether you have been able to find any more information about this?

Offline Phystam jp

  • *
  • Posts: 88
  • (=*^ω^*=)
  • Languages: JP, EN
Re: Segmentation fault report: multi-threading in Network game
« Reply #3 on: May 05, 2018, 02:02:11 PM »
Sorry for late reply, I have forgotten about this.
This is the traceback of the segv. This error occurred only when we play in multi-thread version.


This error appeared very frequently, so I think that there is a multi-threading fault around this code, but I could not find it.
Thank you for reminding me.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17194
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Segmentation fault report: multi-threading in Network game
« Reply #4 on: May 05, 2018, 02:35:21 PM »
Thank you for the backtrace. That looks as though something in the transferring_cargoes collection is getting corrupted/deleted without being removed from the list somehow. Do you get this problem with any of the pre-compiled binaries, or only with your own builds?

Offline Phystam jp

  • *
  • Posts: 88
  • (=*^ω^*=)
  • Languages: JP, EN
Re: Segmentation fault report: multi-threading in Network game
« Reply #5 on: May 05, 2018, 02:54:59 PM »
This is the my own build. We tried using the nightly build version (windows 64bit), however, the same trouble occurred.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17194
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Segmentation fault report: multi-threading in Network game
« Reply #6 on: May 05, 2018, 06:18:59 PM »
That is very odd - I have not seen this with running the pre-compiled builds on my Windows machine. Does the problem occur only when the game is run as a server, or do you also find that it occurs when run as a client?

Offline Phystam jp

  • *
  • Posts: 88
  • (=*^ω^*=)
  • Languages: JP, EN
Re: Segmentation fault report: multi-threading in Network game
« Reply #7 on: May 05, 2018, 06:32:24 PM »
Only as a client. The server do not show this error.
I am using core i5-8400 CPU (6 cores), so my computer can have more threads than clients' one.
I doubt that a client cannot handle the thread numbers that the server have.
We tried using single-thread version, then successfully it worked.

I reminded another phenomenon --- LINUX (including WSL and virtual environment) clients could connect without the segmentation fault. I cannot understand this.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17194
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Segmentation fault report: multi-threading in Network game
« Reply #8 on: May 05, 2018, 06:44:03 PM »
How very odd, especially that I cannot reproduce this.

There was someone else who reported odd crashes with the Windows builds using Windows 10 that were solved by using Windows 8 compatibility mode; if you are running Windows 10, may I suggest trying this?

Offline Phystam jp

  • *
  • Posts: 88
  • (=*^ω^*=)
  • Languages: JP, EN
Re: Segmentation fault report: multi-threading in Network game
« Reply #9 on: May 05, 2018, 06:49:13 PM »
Oh, I am using windows 10. Okay, I will try it.