New building encyclopedia causes crash with saveloading
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.
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
- TiborB: Approve
- GunChleoc: Needs Resubmitting
- Hans Joachim Desserud: Needs Fixing
-
Diff: 168 lines (+66/-33)3 files modifiedsrc/scripting/lua_map.cc (+46/-20)
src/scripting/lua_map.h (+19/-12)
tribes/scripting/format_help.lua (+1/-1)
description: | updated |
Changed in widelands: | |
assignee: | GunChleoc (gunchleoc) → nobody |
Changed in widelands: | |
assignee: | GunChleoc (gunchleoc) → nobody |
description: | updated |
description: | updated |
Changed in widelands: | |
status: | Triaged → Fix Committed |
Changed in widelands: | |
status: | Fix Committed → Fix Released |
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: upvalues. _ENV.string. reverse) )
Writing Scripting Data ... PANIC: unprotected error in call to Lua API (attempt to persist a light C function (0x1142498) (root.sleep.
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.