[Freeciv-Dev] [bug #21901] Segmentation fault in style_of_nation in Freeciv-web

2014-04-27 Thread Jacob Nevins
Follow-up Comment #9, bug #21901 (project freeciv):

I can't now remember why I didn't make is_playable entirely a server-side
thing when doing the nationsets rework (patch #3448 etc). I certainly
considered but, but ended up with it being the clients' responsibility to
check is_playable; I wonder why?

One effect of this change is that Barbarians and Pirates no longer appear in
the online help. Don't know if there's anything less cosmetic than that.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #21901] Segmentation fault in style_of_nation in Freeciv-web

2014-04-26 Thread Marko Lindqvist
Update of bug #21901 (project freeciv):

  Status:  Ready For Test => Fixed  
 Assigned to:None => cazfi  
 Open/Closed:Open => Closed 


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #21901] Segmentation fault in style_of_nation in Freeciv-web

2014-04-22 Thread Marko Lindqvist
Follow-up Comment #6, bug #21901 (project freeciv):

- Added assert when nation for barbarian player cannot be found

(file #20558)
___

Additional Item Attachment:

File name: PreventUnplayable-2.patch  Size:1 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #21901] Segmentation fault in style_of_nation in Freeciv-web

2014-04-22 Thread Marko Lindqvist
Follow-up Comment #5, bug #21901 (project freeciv):

> - Ruleset sanity check should make sure there is at least 1 not
> is_playable nation of each barbarian type

Actually, this should already be the case. Or rather, ruleset loading should
prevent any barbarian nation from being is_playable:

  if (pnation->barb_type != NOT_A_BARBARIAN
  && pnation->is_playable) {
/* We can't allow players to use barbarian nations, barbarians
 * may run out of nations */
ruleset_error(LOG_ERROR,
  "Nation %s marked both barbarian and playable.",
  nation_rule_name(pnation));
ok = FALSE;
break;
  }

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #21901] Segmentation fault in style_of_nation in Freeciv-web

2014-04-09 Thread Marko Lindqvist
Follow-up Comment #4, bug #21901 (project freeciv):

> A better patch would refuse to spawn sea_barbarians if there
> were no possible nations for them to play.

That was jus t a quick fix to one of the bugs (currently is_playable has no
effect) In total there should be 3 things done:

- Prevent taking nation that is not is_playable
- Ruleset sanity check should make sure there is at least 1 not is_playable
nation of each barbarian type
- Handle the error that no nation is found to create the barbarian (in theory
assert would be enough with the above fix)


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #21901] Segmentation fault in style_of_nation in Freeciv-web

2014-04-09 Thread anonymous
Follow-up Comment #3, bug #21901 (project freeciv):

This is an old bug. It was discussed on longturn a few years ago. It has
recently been discussed on greatturn.
see http://civland.org/forum/viewtopic.php?f=98&t=946#p4336

Enabling ai sea-barbarians is not the same as allowing allowing a human player
to player the pirate nation. Any nation in the nation list can be set as the
sea-barbarians merely by adding the line
barbarian_type = "Sea"
into the relevant national ruleset. What cannot happen is to have enabled ai
sea-barbarians but no nation for them to play. By default the pirates are the
only sea-barbarians. If a human plays the pirates you must choose another
nation to be the sea-barbarians or the server will crash when it tries to
spawn a new nation.

The patch won't really help because people hacking the ruleset files will
alter the is_playable flag in the pirate nation so they can play pirates.

A better patch would refuse to spawn sea_barbarians if there were no possible
nations for them to play.


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #21901] Segmentation fault in style_of_nation in Freeciv-web

2014-04-09 Thread Marko Lindqvist
Update of bug #21901 (project freeciv):

Category: freeciv-web => general
  Status:None => Ready For Test 
 Planned Release: => 2.5.0, 2.6.0   

___

Follow-up Comment #2:

In mailing list:
> I just noticed that it's possible to select the Pirate nation
> to play in Freeciv-web, perhaps someone did that? Or it could
> be something else entirely...

That could explain how it's no longer available when sea barbarians are
created.

Attached patch should prevent player from selecting unplayable nations for
themselves.

(file #20503)
___

Additional Item Attachment:

File name: PreventUnplayable.patchSize:0 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] [bug #21901] Segmentation fault in style_of_nation in Freeciv-web

2014-04-09 Thread Andreas Røsdal

On Wed, 9 Apr 2014, Marko Lindqvist wrote:

Follow-up Comment #1, bug #21901 (project freeciv):


#1 0x080521a6 in player_nation_defaults
(pplayer=pplayer@entry=0x9d22428,
pnation=pnation@entry=0x0, set_name=set_name@entry=true) at
srv_main.c:2056
pleader = 


nation = NULL...


#2 0x0808596d in create_barbarian_player (type=SEA_BARBARIAN)


...when creating sea barbarians.

Can you check
1) If there's some errors logged about Pirate nation when loading ruleset


There's no such error message about loading the Pirate nation. Usually the 
Pirate nation works fine in most games. This could have been a normal 
game, or perhaps a scenario. I just noticed that it's possible to select 
the Pirate nation to play in Freeciv-web, perhaps someone did that? Or it 
could be something else entirely...



2) If Pirate nation somehow is already in use in the game


How can I check thath? I don't have any savegame, this is on the public 
server.


If I could suggest a solution to this, then perhaps we could add some 
check if the nation is NULL, and then don't allow creation of the Pirate 
nation. Anything to prevent the segfault. :)


Andreas

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #21901] Segmentation fault in style_of_nation in Freeciv-web

2014-04-09 Thread Marko Lindqvist
Follow-up Comment #1, bug #21901 (project freeciv):

> #1 0x080521a6 in player_nation_defaults
> (pplayer=pplayer@entry=0x9d22428,
> pnation=pnation@entry=0x0, set_name=set_name@entry=true) at
> srv_main.c:2056
> pleader = 

 nation = NULL...

> #2 0x0808596d in create_barbarian_player (type=SEA_BARBARIAN) 

 ...when creating sea barbarians.

 Can you check
1) If there's some errors logged about Pirate nation when loading ruleset
2) If Pirate nation somehow is already in use in the game


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #21901] Segmentation fault in style_of_nation in Freeciv-web

2014-04-09 Thread Andreas Rosdal
URL:
  

 Summary: Segmentation fault in style_of_nation in Freeciv-web
 Project: Freeciv
Submitted by: andreasr
Submitted on: Wed 09 Apr 2014 06:35:24 PM UTC
Category: freeciv-web
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

Segmentation fault in Freeciv-web, in style_of_nation in nation.c. This is
with the Freeciv C server SVN revision 24737.
Any help with this?


Program terminated with signal 11, Segmentation fault.
#0  0x08147364 in style_of_nation (pnation=pnation@entry=0x0) at nation.c:671
No locals.
#1  0x080521a6 in player_nation_defaults (pplayer=pplayer@entry=0x9d22428,
pnation=pnation@entry=0x0, set_name=set_name@entry=true) at
srv_main.c:2056
pleader = 
#2  0x0808596d in create_barbarian_player (type=SEA_BARBARIAN)
at barbarian.c:128
barbarians = 0x9d22428
nation = 0x0
__FUNCTION__ = "create_barbarian_player"
#3  0x08086c42 in try_summon_barbarians () at barbarian.c:563
boat = 0x8320f40 
dist = 0
barbarians = 0x0
hut_present = false
ptile = 0x8320f40 
#4  summon_barbarians () at barbarian.c:668
i = 0
n = 164766760
#5  0x08053627 in end_turn () at srv_main.c:1127
food = 
shields = 
trade = 
i = 0
n = 164766760
#5  0x08053627 in end_turn () at srv_main.c:1127
food = 
shields = 
trade = 
---Type  to continue, or q  to quit---
settlers = 
#6  srv_running () at srv_main.c:2426
save_counter = 
i = 
is_new_turn = 
skip_mapimg = 
eot_timer = 
need_send_pending_events = 
#7  srv_main () at srv_main.c:2879
__FUNCTION__ = "srv_main"
#8  0x0804cb02 in main (argc=17, argv=0xbf9eb0e4) at civserver.c:458
inx = 17
showhelp = 
showvers = 
option = 
__FUNCTION__ = "main"





___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev