[Freeciv-Dev] [bug #19007] Player slots miscounted when saving/loading known tiles => crashes and/or players forgetting territory

2011-11-19 Thread Jacob Nevins

Update of bug #19007 (project freeciv):

  Status:  Ready For Test => Fixed  
 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 #19007] Player slots miscounted when saving/loading known tiles => crashes and/or players forgetting territory

2011-11-19 Thread Michal Mazurek

Follow-up Comment #7, bug #19007 (project freeciv):

> For me there are odd disconnected spots of known territory
This may be what I had and posted some time ago! Then I blamed it on possible
sea map trade.

___

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 #19007] Player slots miscounted when saving/loading known tiles => crashes and/or players forgetting territory

2011-11-19 Thread Jacob Nevins

Follow-up Comment #6, bug #19007 (project freeciv):

Results of some experiments to confirm my analysis.

Attached a savegame produced by a broken server. Two players, one at index 0,
the other ("P125") at index 125; all slots in between are unused.

On reloading this into broken server, _most_ of the previously explored
territory (for which you'll have to take my word) has disappeared. For me
there are odd disconnected spots of known territory, I assume the result of
reading uninitialised memory; I guess the reason this isn't causing a crash
for me but did for akfaew is an Intel+Linux vs Sparc+OpenBSD difference.

Also, P125's client emits hundreds of the following -- this is the sort of
knock-on effect I was suggesting:


1: fill_sprite_array() tile (2,23) has no terrain!
1: fill_sprite_array() tile (5,21) has no terrain!
1: build_tile_data() tile (10,16) has no terrain!
1: build_tile_data() tile (10,18) has no terrain!
1: fill_sprite_array() tile (10,16) has no terrain!
1: build_tile_data() tile (10,18) has no terrain!
1: build_tile_data() tile (10,18) has no terrain!
1: build_tile_data() tile (10,20) has no terrain!


Loading this into a fixed server gives a warning as expected, and the
disconnected spots disappear; all as expected. Exploring more territory,
saving, and loading again, the newly explored territory is preserved. The
client is no longer moaning. Best we could have hoped for, I think.

Loading a fixed savegame into a broken server is much the same as loading a
broken savegame, as expected.

(file #14589)
___

Additional Item Attachment:

File name: idx-someturns.sav.bz2  Size:11 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 #19007] Player slots miscounted when saving/loading known tiles => crashes and/or players forgetting territory

2011-11-19 Thread Jacob Nevins

Update of bug #19007 (project freeciv):

  Status: In Progress => Ready For Test 
 Planned Release:   2.3.2,2.4.0,2.5.0 => 2.3.1,2.4.0,2.5.0  
 Summary: fix known map in savegame2 => Player slots
miscounted when saving/loading known tiles => crashes and/or players
forgetting territory

___

Follow-up Comment #5:

Per bug #18776 comment 32 ,
I'm repurposing this bug to be just about the slot miscounting (which is what
the currently attached file, file #14565, fixes). IMO, this is a low-risk
change so I'm going to put it in 2.3.1.

The other stuff mentioned in comment #2 and comment #3 -- divisor confusion
-- is for a new bug: bug #19029.

Description copied from the other bug:

== Player slots miscounted when loading/saving known tiles ==

file #14579:  0005-basic-fix-known-map-in-savegame2.patch
(which is basically the same as file #14565)

_Bug:_ if the usage of player slots is sparse, then depending on luck and
alignment, you can see either:
* Segfaults or other misbehaviour, due to indexing off the end of a malloc'd
array.
* The known-tiles status of higher-indexed players is not saved or loaded.
Such players will probably forget all the map they knew on reload. (I don't
know if that has knock-on effects elsewhere, since their player maps will
presumably have an opinion on what the terrain at those tiles is supposed to
be. Can't rule out segfaults/assertion failures.)

With the fix, I think loading from a savefile affected by the bug will
produce the following warning: "Saved game contains incomplete map data. This
can happen with old saved games, or it may indicate an invalid saved game
file. Proceed at your own risk." and carry on. That seems appropriate. Any
knock-on effects will be present in games loaded from these savegames.

Gaps in player slots can appear whenever /remove is used, whether in-game or
pre-game. (Thus, reverting bug #18641 won't hide this bug.)

_Risk/benefit:_ this change is simple and looks low-risk to me; can't see
that it can break things, especially if /remove is not used. It fixes an
observed segfault (bug #18776 comment 21).

*Conclusion:* Apply this "basic" patch before 2.3.1. Cross fingers.

___

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