Segfault right after colony harbour is constructed

Bug #1638890 reported by xxx-deleted
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

Right after the port of my first colony is constructed, widelands crashes with a segfault:

Widelands::PortDock::get_fleet (this=0x0) at /home/janosch/Dev/widelands-repo/trunk/src/economy/portdock.h:85

See attached the output of gdb.

To reproduce, load the attached savegame and wait until the port is constructed.

This happens in bzr8169.

Related branches

Revision history for this message
xxx-deleted (janosch-peters-deactivatedaccount) wrote :
Revision history for this message
xxx-deleted (janosch-peters-deactivatedaccount) wrote :
Revision history for this message
GunChleoc (gunchleoc) wrote :

The lase message before the segfault is:

Attempting to setup port without neighboring water (coords: 28x 67).

So, the port might have no portdock to get the fleet from.

I'm attaching the map so that we can chck if this is a regression. Will do some more digging.

GunChleoc (gunchleoc)
Changed in widelands:
status: New → Confirmed
tags: added: crash
Revision history for this message
GunChleoc (gunchleoc) wrote :

I think I understand what is happening: The enemy border is too close, so there is no space to put the portdock.

We have had this problem before and Tibor did some improvements, so this is not a release blocker.

I think a long-term solution here would be to give ports a special construction site that conquers enough area to house a portdock, and to keep that area conquered when we transform the construction site into the port.

Changed in widelands:
milestone: none → build20-rc1
status: Confirmed → Triaged
importance: Undecided → High
tags: added: military
Revision history for this message
TiborB (tiborb95) wrote :

If I remember properly, port used to claim portdock fields in any nearby water, not checking ownership at all and later on it lead to crash. Now if at least one owned water field is available - no problem - portdock is created there. It is dilemma whether is is a showstopper or we have to accept it for now. Anyway this is very rare. I would be for ignoring the issue for now as a lesser of two evils.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I have just had another idea - would allowing to build portdocks in enemy territory solve the problem here?

And it's definitely not a showstopper - it was worse in Build 18 ;)

Revision history for this message
xxx-deleted (janosch-peters-deactivatedaccount) wrote :

I pushed a fix: After finiishin construction, the harbour conquers every location where it has the highest military influence. with this change, the chance of owning a valid portdock location is very high, because they are close to the harbour (here the influence factor is high).

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

This bug seems to have reared its head again: https://wl.widelands.org/forum/topic/2852/?page=1#post-20111

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

The attached savegame will crash in Build 19 but not in current trunk, so this bug is still fixed.

Changed in widelands:
status: Confirmed → Fix Committed
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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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