News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Segmentation fault report: multi-threading in Network game

Started by Phystam, March 15, 2018, 09:09:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Phystam

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.

jamespetts

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.

jamespetts

Can I check whether you have been able to find any more information about this?
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.

Phystam

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.

jamespetts

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?
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.

Phystam

This is the my own build. We tried using the nightly build version (windows 64bit), however, the same trouble occurred.

jamespetts

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?
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.

Phystam

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.

jamespetts

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?
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.

Phystam


jamespetts

Can I check whether using Windows 8 compatibility mode assisted with this?
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.

Phystam

Sorry, I no longer have a network game, so I cannot confirm immediately.
The next game will start from 15th June. Then we will confirm this issue.