#1 17.07.2012 12:07:55

det0r
Player
Posts: 166

Debugging

Somebody needs to debug the civ server and find the cause of the segmentation fault. I'm moving to Australia in a few weeks and I might have time to look into it once I'm settled in, but that won't be until early October. As far as I know, akfaew is very busy at the moment so he doesn't have time.

So, any volunteers? Maybe somebody can write a nicely worded e-mail to one of the freeciv developers? I assume nobody will be against making the savegame available? The game is over anyway...

Offline

#2 17.07.2012 12:43:46

kingofnerds
Player
From: Sunrise, Florida
Posts: 28
Website

Re: Debugging

No, I am not against making the Savegame available to people wanting to determine the cause of the failure... Question, were the Pirates ever removed? Was it determined that the Pirates were definitely related to the cause of the Segfault?


==== In the end, Nerds with Linux will rule the world ====

Offline

#3 17.07.2012 22:04:22

det0r
Player
Posts: 166

Re: Debugging

kingofnerds wrote:

Question, were the Pirates ever removed? Was it determined that the Pirates were definitely related to the cause of the Segfault?

I don't think so. Kevin made a few comments about how pirates are generated in another thread - if somebody wants to compile a server version that has the 'pirate spawning' fixed then that could be a good start. I don't mind playing a game 'with the risk of crashing' if its necessary for play-testing, but it does waste a lot of akfaew's time if he has to keep restarting the server every day.

Offline

#4 18.07.2012 00:46:11

kevin551
Player
Posts: 285

Re: Debugging

I will repeat my comment from before.
The Freeciv server is not broken - it does not need to be fixed or compiled.

The crash is caused because longturn altered the ruleset.
Last game we altered the file pirates.ruelset in the nations folder to make pirates playable.
The lines changed were
is_playable = 0
barbarian_type = "Sea"

There are two possible fixes
1. Keep pirates and make pirates unplayable by a human player. Add the two lines back into pirates.ruleset
2. Remove pirates from this game.

The problems with the fixes.
1. Changes to the nations folder will affect all games. The code that allows players to choose what nation they want will need to be changed.

2. Removing a nation that cannot be created is potentially problematic. It may not be easy to remove pirates. I don't know. Perhaps someone could test this.

Offline

#5 18.07.2012 07:13:33

Grendel
Player
Posts: 45

Re: Debugging

Just speculation here...

I don't think removing those two lines are what did it.  If the game does not have a barbarian of each type, land and sea, the server crashes at game start with the message:
No land barbarian nation defined.  At least one required.
...unless we changed code to circumvent that.

I think the problem may be with the Barbarian nation, as opposed to Pirates.  Players had seen pirates, so spawning pirates seems ok.  It was T60 when we had first crash, which is default onsetbarbs setting.  Maybe game first tried to make land barbs and crashed.  Then admin restarted and second time it decided to make pirates.  Then exactly ten turns later, it tries to make land barbs again and crashes.  I am guessing there is a player playing land barbs and the game can't find a nation to use for land barbs.  I seem to recall seeing him on the list, but not sure.  There are players signed up for both at any rate.

I think solution would be to edit savegame file and reassign player playing land barbs to another nation or turn off barbarians.

Offline

#6 18.07.2012 19:51:54

kingofnerds
Player
From: Sunrise, Florida
Posts: 28
Website

Re: Debugging

Wasn't it a mistake/oversight that barbarians/pirates were enabled in the first place?


==== In the end, Nerds with Linux will rule the world ====

Offline

#7 19.07.2012 13:20:39

kevin551
Player
Posts: 285

Re: Debugging

The reason the two lines were removed to make pirates and barbarians playable is because of the check you just found.

In file ruleset.c is the check
    if (fc_strcasecmp(barb_type, "Sea") == 0) {
      if (pnation->is_playable) {
        /* We can't allow players to use barbarian nations, barbarians
         * may run out of nations */
        ruleset_error(LOG_FATAL,
                      "Nation %s marked both barbarian and playable.",
                      nation_rule_name(pnation));

This checks to make sure nations marked as sea barbarians are not playable
Hence you cannot make pirates playable unless you also remove the second line. So we removed both. There is no problem starting the server with both lines removed.

Last edited by kevin551 (19.07.2012 13:23:15)

Offline

#8 23.07.2012 05:13:31

kevin551
Player
Posts: 285

Re: Debugging

kingofnerds wrote:

Wasn't it a mistake/oversight that barbarians/pirates were enabled in the first place?

Yes. A small mistake at the start has caused a major problem now.

If Grendel is right and it is barbarians causing this problem not pirates then there is an easy fix. Just turn off the creation of barbarians. We can leave the pirates in place.

In future games we just need to remember to disable barbarians/pirates before the start.

Offline

#9 15.03.2013 04:27:40

kevin551
Player
Posts: 285

Re: Debugging

Too late now - but it appears a patch for the bug that killed this game has now been written. (Note it was written to allow multiple barbarian nations, not to fix our case which was when the server tried to spawn barbarians and there were no nations available - but it fixes both.)

patch #3776: server/barbarian.c:create_barbarian_player fix deficencies patches for the case "If for some reason the pick_a_nation-function returns NULL, the server crashes with segmentation fault. "

Offline

Board footer

Powered by FluxBB