END OF EXPEDITION due to time-out schip.cc assertion failed

Bug #1678598 reported by Klaus Halfmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Critical
Unassigned

Bug Description

I played "The Nile" and conquere a (the last) castle for player 1, blue at 11,96
I continued playing for about 5 minutes. then I got:

5: Azurea Sea at 100x 98: END OF EXPEDITION due to time-out
Assertion failed: (get_economy() && get_economy() != expedition_->economy.get()), function exp_cancel, file /Users/klaus/develop/widelands-repo/widelands/src/logic/map_objects/tribes/ship.cc, line 923.

I would assume that the poor ship had no owner and no economy any longer.

Suggestions: such a ship should eihter destory itself on continue its expeditions
(Unless there are no more port spaces).

Related branches

Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

After loading this second file I must wait unil 11:41 and the got the crash,
can someone confirm?

tags: added: crash economy seafaring
Revision history for this message
Notabilis (notabilis27) wrote :

Crashes after a few seconds for me, too. But took me some time to figure out that it is a multiplayer game, so of course it doesn't appear in the single player load screen. ;-)

The assertion fails since get_economy() returns a null pointer. A backtrace is attached.

Revision history for this message
Notabilis (notabilis27) wrote :

A simple fix seems to be:
 if (get_economy() == nullptr) {
  sink_ship(game);
  return;
 }
in front of the assertion (src/logic/map_objects/tribes/ship.cc:923).
At least, it doesn't crashes any longer. But I haven't really read the code, and I guess some digging should be done why the economy is null anyway.

GunChleoc (gunchleoc)
Changed in widelands:
status: New → Triaged
milestone: none → build20-rc1
importance: Undecided → Critical
Revision history for this message
GunChleoc (gunchleoc) wrote :

What happens is that grey player has lost their port, so there is no port to return to for the canceled expedition. So, I'd suggest (pseudocode):

if (get_economy() == nullptr) {
  if (has_other_reachable_portdock()) {
    add_ship_to_reachable_portdocks_fleet();
  } else {
    return;
  }
}

do_cancel_expedition;

GunChleoc (gunchleoc)
Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
Revision history for this message
GunChleoc (gunchleoc) wrote :

Singleplayer savegame with 2 ports and 2 expeditions for further testing.

Revision history for this message
GunChleoc (gunchleoc) wrote :

The code already looks for a reachable port dock, so the final fix is:

If no reachable port dock found:
- Reset Expedition state
- Warning dialog shown to owning player
- AI continues exploring

Changed in widelands:
status: Triaged → Fix Committed
assignee: GunChleoc (gunchleoc) → nobody
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-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

Remote bug watches

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