New building encyclopedia causes crash with saveloading

Bug #1455732 reported by GunChleoc
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Critical
Unassigned

Bug Description

Widelands will crash with saveloading when the Tribal Encyclopedia has been opened. To reproduce:

1. Start a new game.
2. Open the Tribal Encyclopedia and select the buildings tab.
3. Select a mine or the dismantling site in the list.
4. Press Ctrl+s and attempt to save the game.

This gives me the following error message, along with a rather long backtrace:
 Writing Scripting Data ... PANIC: unprotected error in call to Lua API (attempt to persist a light C function (0x1142498) (root.sleep.upvalues._ENV.string.reverse))

The light C function is a different one every time. So, we are probably having Fun With Pointers (tm) here.

1. DismantleSite wasn't available in lua_map. I fixed that one in the linked branch.

2. The Mine case tries and fails to persist stuff that it can't. I haven't been able to find the cause.

Related branches

GunChleoc (gunchleoc)
description: updated
Changed in widelands:
assignee: GunChleoc (gunchleoc) → nobody
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for reporting.

I found a way to trigger a reproducible crash.
1. Start a new game.
2. Open the Tribal Encyclopedia and select the buildings tab.
3. Select the dismantlig site in the list.
4. Select another building.
5. Press Ctrl+s and attempt to save the game.

This gives me the following error message, along with a rather long backtrace:
 Writing Scripting Data ... PANIC: unprotected error in call to Lua API (attempt to persist a light C function (0x1142498) (root.sleep.upvalues._ENV.string.reverse))

It looks like the trigger is if the dismantlig site has been selected and then deselected. I have not been able to trigger a crash with the other normal buildings nor construction site.

(I've also noted that headquarter type buildings do not display an icon in the list but are shown in the panel on the right when you select one of them. This difference is what led me to experiment with the icon-less entries in the first place, though this seems unrelated to the crash)

If you are able to trigger the same crash, I believe we can mark this as Triaged. Even though we aren't really sure what's causing it, we have enough info for someone to start working on it.

Changed in widelands:
milestone: none → build19-rc1
status: New → Confirmed
tags: added: savegame ui
tags: added: lua
Revision history for this message
GunChleoc (gunchleoc) wrote :

Maybe it doesn't like that construction sites don't have a help.lua.

I can reproduce this, so I'll go investigate. Thanks for finding the crash :)

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

OK, we actually have 2 bugs here:

1. DismantleSite wasn't available in lua_map. I fixed that one in the linked branch.

2. The ConstructionSite case tries and fails to persist stuff that it can't, but only if you click on another building afterwards.

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

@hjd, will you test also GunChleoc's merge proposal? You know what to look for.

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

Fixed in build19-rc1.

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.