Remove ware removes wares without placing them outside the building (can trigger crash)

Bug #1093848 reported by Hans Joachim Desserud on 2012-12-26
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Nicolai Hähnle

Bug Description

(Originally reported by destrier on irc. Thank you :) )

Steps to reproduce:
1. Start a new game.
2. Open your HQ and pick some random ware like Axes
3. Mark it "Remove ware"
4. Build a flag and connect it with a road to your HQ
5. Wait a while after the ware counter has hit zero, then attempt to exit the game.

Expected result:
The wares should be placed by the flag outside your HQ. When quiting the game, you should end up back at the main menu.

Actual result:
First of all, the wares are not placed by the flag, the counter is merely deincremented.
Secondly, when quiting in this state, the game will crash (see attached backtrace).

I've experimented a bit and it seems like the road is somehow needed to trigger the crash, because there are ways where it will not crash. Still no wares by the flag in any case though. This might in fact be two different bugs, since it sometimes crash and sometimes doesn't, but they are likely too related to be fixed separately.

The original reporter was running Widelands build 17 on Windows 7, and I was able to reproduce it on Ubuntu 12.10 with Widelands r6465.

Related branches

Hans Joachim Desserud (hjd) wrote :
Nasenbaer (nasenbaer) on 2012-12-26
Changed in widelands:
status: New → Confirmed
importance: Medium → High
Nasenbaer (nasenbaer) wrote :

Very strange, I know this feature has worked at some point in development. Anyway I can confirm at least the first part of the bug (ware not beeing carried out) for build17 and current development snapshot. This is a major problem and I think we should even treat it as a blocker for build18-rc1

Changed in widelands:
importance: High → Critical
_aD (ad-simplypeachy) wrote :

I may have been seeing similar behaviour since revision 6432. I had no crashes when playing or quitting using 6432 or earlier, but since then the game crashes when quitting approximately 50% of the time. I open the in-game options menu, click the Exit Game icon and the window would close. In my case it did not trigger Windows Error Reporting, display an error message or write anything helpful in the logs.

I know that occasionally the Windows builds can exhibit this sort of crash (although it has been very rare in the last year or so), so didn't report it. It is possible that the crashes I've seen are a result of this bug, but I had not notice any pattern to it - I posted this comment to give you an idea of when it may have started.

Hans Joachim Desserud (hjd) wrote :

Yes, I know this feature has worked too, but I don't remember when I successfully used it the last time. Could someone look into whether this can have regressed around the time we added ports and ships? I don't know how much code they share, but ports looks like a special-case ware house, so it might be related to whether the wares should be loaded onto a ship or sent by the road network.

Gabriel Margiani (gamag) wrote :

After removing the wares from the HQ they can be used and are carryed out of the HQ if they are needed.
I can reproduce the crash only when I have used some of the wares, which I removed from the HQ before.
I get errors like this:

WareList: 16 items of 35 left.
terminate called after throwing an instance of '_wexception'
  what(): [/home/gabriel/checkouts/wl/wl_1/src/economy/] SupplyList::remove: not in list


WareList: 3 items of 7 left.


Nicolai Hähnle (nha) wrote :

This bug is in two parts. The first part is that the wares are not transported out of the warehouse. The second part is that WareInstances whose location is a building are not properly updated for changes in the economy or the destruction of their location. I am working on a fix for both.

Changed in widelands:
assignee: nobody → Nicolai Hähnle (nha)
Changed in widelands:
status: Confirmed → In Progress
Nicolai Hähnle (nha) wrote :

Fix committed to trunk in bzr6508.

Changed in widelands:
status: In Progress → Fix Committed
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  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments