crash
Moderator: Moderators
crash
every time i do /luaui reload, my spring crashes (tested on singleplayer)
Core 2 Duo 2.4
1.5GB ram
GeForce 7600GS
i removed all widgets from LuaUI/widgets and it still crashes
it happens only with BA6.1 (so, it is also BA bug, but it should not crash spring probably, just luaui)
here is infolog:
http://pastebin.com/f7bc4e9c9
Core 2 Duo 2.4
1.5GB ram
GeForce 7600GS
i removed all widgets from LuaUI/widgets and it still crashes
it happens only with BA6.1 (so, it is also BA bug, but it should not crash spring probably, just luaui)
here is infolog:
http://pastebin.com/f7bc4e9c9
Re: crash
I fed it to the stacktrace translator:
http://pastebin.com/m5da1ce0d
EDIT: From the length and structure of this thing, I'd say a stack overflow from some infinite recursion.
http://pastebin.com/m5da1ce0d
EDIT: From the length and structure of this thing, I'd say a stack overflow from some infinite recursion.
Re: crash
Do you also get the:NOiZE wrote:i get the same crash.... when i do /luaui reload with BA61 and my infolog says the same then.
LuaUI::RunCallIn: error = 2, LayoutButtons, [string "LuaUI/layout.lua"]:113: attempt to perform arithmetic on global 'activePage' (a nil value)
LuaUI::RunCallIn: error = 2, LayoutButtons, [string "LuaUI/layout.lua"]:113: attempt to perform arithmetic on global 'activePage' (a nil value)
LuaUI::RunCallIn: error = 2, LayoutButtons, [string "LuaUI/layout.lua"]:113: attempt to perform arithmetic on global 'activePage' (a nil value)
LuaUI::RunCallIn: error = 2, LayoutButtons, [string "LuaUI/layout.lua"]:113: attempt to perform arithmetic on global 'activePage' (a nil value)
LuaUI::RunCallIn: error = 2, LayoutButtons, [string "LuaUI/layout.lua"]:113: attempt to perform arithmetic on global 'activePage' (a nil value)
LuaUI::RunCallIn: error = 2, LayoutButtons, [string "LuaUI/layout.lua"]:113: attempt to perform arithmetic on global 'activePage' (a nil value)
LuaUI::RunCallIn: error = 2, LayoutButtons, [string "LuaUI/layout.lua"]:113: attempt to perform arithmetic on global 'activePage' (a nil value)
LuaUI::RunCallIn: error = 2, LayoutButtons, [string "LuaUI/layout.lua"]:113: attempt to perform arithmetic on global 'activePage' (a nil value)
LuaUI::RunCallIn: error = 2, LayoutButtons, [string "LuaUI/layout.lua"]:113: attempt to perform arithmetic on global 'activePage' (a nil value)
Re: crash
I've finally tracked down this elusive little bugger (BTW with the help of the Lua trace script I posted in the Lua section, very helpful).
It's a bit complicated, so bear with me. What happens when the UI is reloaded is this:
The fix is easy, a one-liner in fact: change layout.lua to read
Unfortunately I don't have SVN access.
It's a bit complicated, so bear with me. What happens when the UI is reloaded is this:
- The Lua context is torn down and re-initialized from scratch.
- The LuaUI widget manager initializes itself and runs each widget's Initialize method.
- The BA Layout widget's Initialize method invokes the console command "/ctrlpanel" with the mod's custom ctrlpanel.txt, which in turn calls CGuiHandler::ReloadConfig.
- ReloadConfig calls LayoutIcons, which eventually does a Lua callin for LayoutButtons.
- At this point, the BA widget hasn't yet registered its LayoutButtons replacement function, so the default LuaUI handler is called.
- This handler, DefaultHandler in layout.lua, tries to access the global variable activePage, which hasn't been set at this point. We get an error.
- The callin function catches the error and tries to shutdown LuaUI.
- LuaUI calls each widget's Shutdown method.
- The BA layout widget, in its Shutdown method, again issues a /ctrlpanel command to reset to default settings. Back to step 4.
The fix is easy, a one-liner in fact: change layout.lua to read
Code: Select all
if (xIcons > 2) then
local color
if (commands[1].id < 0) then color = GreenStr else color = RedStr end
local activePage = activePage or 0 -- <- this is the line to be added --
local pageNum = '' .. (activePage + 1) .. ''
PageNumCmd.name = color .. ' ' .. pageNum .. ' '
table.insert(customCmds, PageNumCmd)
pageNumCmd = cmdCount + 1
end