Unseen port crashes the game when saving

Bug #1199653 reported by Teppo Mäenpää
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Medium
cghislai

Bug Description

Widelands crashes with assert(false) while saving, if a ship on expedition has passed by a foreign tribe's port.

To reproduce:
1) Load the attached savegame, using current head ( lp:widelands/trunk/6601 )
2) Let the game advance until a ship has passed by port at (128,8) or just wait for half-a-minute
3) Save the game

The attached savegame has been run on number of development versions. This could have contributed to the crash -> might not be a bug.

Related branches

Revision history for this message
Teppo Mäenpää (kxq) wrote :
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for reporting this issue.

I got the following assertion error when following the steps you provided:

widelands_map_players_view_data_packet.cc::write_unseen_immovable(): N9Widelands16Map_Object_DescrE portdock (Port Dock) was not expected.
widelands: /home/user/widelands/src/map_io/widelands_map_players_view_data_packet.cc:772: void Widelands::write_unseen_immovable(const Widelands::Map_Object_Data*, BitOutBuffer<2u>&, Widelands::FileWrite&): Assertion `false' failed.

Program received signal SIGABRT, Aborted.

(Oh, and I added a couple of tags to this bug report)

Changed in widelands:
importance: Low → Medium
status: New → Confirmed
tags: added: crash savegame seafaring
Changed in widelands:
milestone: none → build18-rc1
summary: - Unseen port crashes the game
+ Unseen port crashes the game when saving
Revision history for this message
cghislai (charlyghislain) wrote :

Port dock extends base immovable, and implements its own Map_Object_Descr, like flags do.
Unlike flags, however, the map_object_descr is not checked for this case and fallback to te asser false.

I'm currently testing the following
- added definition of portdock_descr in instances.h
- added a new unseen immovable_kind with value 4. This will make savegame file format change, but should be backward compatible.

Changed in widelands:
assignee: nobody → cghislai (charlyghislain)
Revision history for this message
cghislai (charlyghislain) wrote :

This patch used the approach explained above.

However, the byte length of the paquets had to be increased, thus the savegames will no be backward compatible.

Another option could be to define the portdock immovable in conf files, so that a Immovable_Descr instance is created.

(ps i will use branches next time)

Changed in widelands:
status: Confirmed → In Progress
Revision history for this message
cghislai (charlyghislain) wrote :

I removed the patch, the fix can be found in the related branch.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Nice. :) When you think the branch is ready to be included, go to the branch page and click on the link named "Propose for merging". This will create a merge proposal with a nice colorcoded diff and allow others to comment on the changes. It will also show up in the list of active reviews https://code.launchpad.net/widelands/+activereviews.

Revision history for this message
SirVer (sirver) wrote :

I proposed the branch for merge and marked it to need fixing myself - feeling totally meta right now. 8)

SirVer (sirver)
Changed in widelands:
status: In Progress → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Released in build-18 rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.