Zero-K icon indicating copy to clipboard operation
Zero-K copied to clipboard

Lua errors from post engine change

Open sprunk opened this issue 6 months ago • 2 comments

  • https://github.com/ZeroK-RTS/CrashReports/issues/144441
[t=04:32:26.777753][f=0083144] Error: gl.BeginEnd: error(2) = [string "lups/ParticleClasses/nanolasersnoshader.lua"]:122: bad argument #1 to 'unpack' (table expected, got number)
[t=04:32:26.777811][f=0083144] Error: [LuaRules::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=DrawWorld trace=[Internal Lua error: Call failure] [string "lups/ParticleClasses/nanolasersnoshader.lua"]:122: bad argument #1 to 'unpack' (table expected, got number)
  • https://github.com/ZeroK-RTS/CrashReports/issues/144440
[t=00:05:52.358991][f=0005858] Error: [LuaRules::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=DrawWorld trace=[Internal Lua error: Call failure] [string "lups/ParticleClasses/nanolasers.lua"]:143: bad argument #2 to 'glMultiTexCoord' (number expected, got +-NaN (check your code for div0))
[t=00:05:52.375609][f=0005858] div0 detected, self.scane_mult, 6.63776064
[t=00:05:52.375625][f=0005858] startPos = {
[t=00:05:52.375632][f=0005858]     1 = 4320
[t=00:05:52.375638][f=0005858]     2 = 75.7811203
[t=00:05:52.375643][f=0005858]     3 = 3632
[t=00:05:52.375647][f=0005858] },
[t=00:05:52.375652][f=0005858] endPos = {
[t=00:05:52.375656][f=0005858]     1 = 4320
[t=00:05:52.375660][f=0005858]     2 = 75.7811203
[t=00:05:52.375666][f=0005858]     3 = 3632
[t=00:05:52.375670][f=0005858] },
[t=00:05:52.375688][f=0005858] self.normdir = {
[t=00:05:52.375696][f=0005858]     1 = nan
[t=00:05:52.375701][f=0005858]     2 = nan
[t=00:05:52.375705][f=0005858]     3 = nan
[t=00:05:52.375711][f=0005858] },
  • https://github.com/ZeroK-RTS/CrashReports/issues/144293
------- TRUNCATED -------
	(tail call): ?
[t=00:07:21.819236][f=0006600] [Game::ClientReadNet][LOGMSG] sender="morchiis" string="[Internal Lua error: Call failure] [string "LuaRules/Gadgets/endgame_graphs.lua"]:294: attempt to perform arithmetic on local 'fullCost' (a nil value)
stack traceback:
	[string "LuaRules/Gadgets/endgame_graphs.lua"]:294: in function 'RegenerateNanoframeValues'
	[string "LuaRules/Gadgets/endgame_graphs.lua"]:329: in function 'GameFrame'
	[string "LuaRules/gadgets.lua"]:1011: in function <[string "LuaRules/gadgets.lua"]:1007>
	(tail call): ?"
[t=00:07:22.803550][f=0006630] Error: [LuaRules::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=GameFrame trace=[Internal Lua error: Call failure] [string "LuaRules/Gadgets/endgame_graphs.lua"]:294: attempt to perform arithmetic on local 'fullCost' (a nil value)
stack traceback:
	[string "LuaRules/Gadgets/endgame_graphs.lua"]:294: in function 'RegenerateNanoframeValues'
	[string "LuaRules/Gadgets/endgame_graphs.lua"]:329: in function 'GameFrame'
	[string "LuaRules/gadgets.lua"]:1011: in function <[string "LuaRules/gadgets.lua"]:1007>
	(tail call): ?
Zero-K.exe Information: 0 : Chobbyla << GaAddDesignEvent {"Value":"223.166","EventID":"events_2020_05_27:game_v2:unit:first_start_building:staticmex"}
  • seems to be campaign planet 69, but maybe modded? idk https://github.com/ZeroK-RTS/CrashReports/issues/144185
[t=00:07:06.385551][f=0007665] Error: [LuaRules::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=UnitDamaged trace=[Internal Lua error: Call failure] [string "LuaRules/Gadgets/unit_xp.lua"]:65: attempt to perform arithmetic on a nil value
stack traceback:
	[string "LuaRules/Gadgets/unit_xp.lua"]:65: in function 'UnitDamaged'
	[string "LuaRules/gadgets.lua"]:1835: in function <[string "LuaRules/gadgets.lua"]:1814>
	(tail call): ?
  • seems to be trying to load an incompatible save file (looking at the 2nd line), but still worrisome. also a rare instance of LUA_ERRNOIDEA: https://github.com/ZeroK-RTS/CrashReports/issues/144345
[t=00:00:12.677079][f=-000001] Warning: [LSH::LoadGameStartInfo][release=1] file "chicken_ghjtcdyju.ssf" saved by engine version "105.1.1-2511-g747f18b BAR105" incompatible with "2025.04.10"
[t=00:00:12.679114][f=-000001] Error: [PreGame::LoadSaveFile] incompatible save-file specified
[t=00:00:12.680429][f=-000001] [LuaMenuController::Activate(msg="[PreGame] incompatible save-file")] luaMenu=000001b9d2118c80
[t=00:00:12.680569][f=-000001] SetLobbyButtonEnabled, true
[t=00:00:12.680865][f=-000001] Error: [SLC::CheckFixStack] -4 ret-vals (top={5,10} args=0) for callin Update, corrupt stack
[t=00:00:12.680907][f=-000001] Error: [LuaMenu::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=Update trace=[Internal Lua error: Call failure] [No traceback returned]
[t=00:00:12.680957][f=-000001] Error: [LuaMenu::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=IsAbove trace=[Internal Lua error: Call failure] index a table valuenil value
[t=00:00:12.680960][f=-000001] Warning: [luaL_SpringOptCString(def=[No traceback returned])] wrong type for return argument 1 in "LuaMenu::CheckFixStack" (string expected, got function)
[t=00:00:12.681017][f=-000001] Error: [LuaMenu::RunCallInTraceback] error=-1 (LUA_ERRNOIDEA) callin=ActivateMenu trace=[Internal Lua error: Call failure] [No traceback returned]
terminate called after throwing an instance of 'std::system_error'
  what():  Resource deadlock avoided
[t=00:00:12.681152][f=-000001] Error: Spring received an ABORT signal
[t=00:00:12.681162][f=-000001] Error: Error handler invoked for Spring 2025.04.10.
  • looks like the Unit Level Ups mod https://github.com/ZeroK-RTS/CrashReports/issues/144190

[t=02:18:03.195926][f=0066690] Error: [LuaRules::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=GameFrame trace=[Internal Lua error: Call failure] [string "LuaRules/Gadgets/unit_dummy.lua"]:34: table index is nil
stack traceback:
	[string "LuaRules/Gadgets/unit_dummy.lua"]:34: in function 'CreateDummyUnit'
	[string "LuaRules/Gadgets/unit_shielddummy.lua"]:17: in function 'CreateShieldDummy'
	[string "luarules/configs/perkfuncs/perkfunclist/shield.lua"]:3: in function 'onPick'
	[string "LuaRules/Gadgets/unit_class.lua"]:269: in function 'AddPerk'
	[string "LuaRules/Gadgets/unit_autoperkselect.lua"]:74: in function 'GameFrame'
	[string "LuaRules/gadgets.lua"]:1000: in function <[string "LuaRules/gadgets.lua"]:998>
	(tail call): ?
[t=02:18:03.566065][f=0066700] game_message: Shield Dummy (tiny) is under attack
  • some desync https://github.com/ZeroK-RTS/CrashReports/issues/144205 (lua errors duplicate with one of the above)

  • another incompatible save load attempt with different error https://github.com/ZeroK-RTS/CrashReports/issues/143732

[t=00:00:31.752907][f=-000001] Warning: [LSH::LoadGameStartInfo][release=1] file "a.ssf" saved by engine version "105.1.1-2511-g747f18b BAR105" incompatible with "2025.04.10"
[t=00:00:31.756170][f=-000001] Error: [PreGame::LoadSaveFile] incompatible save-file specified
[t=00:00:31.759302][f=-000001] [LuaMenuController::Activate(msg="[PreGame] incompatible save-file")] luaMenu=000002b8f3eda190
[t=00:00:31.759386][f=-000001] SetLobbyButtonEnabled, true
[t=00:00:31.759424][f=-000001] SetLobbyFullscreenMode, 1, 1920, 1080
[t=00:00:31.761959][f=-000001] Error: gl.ActiveTexture: error(2) = 0
[t=00:00:31.762162][f=-000001] Error: [LuaMenu::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=ActivateMenu trace=[Internal Lua error: Call failure] attempt to concatenate a table value
terminate called after throwing an instance of 'std::system_error'
  • yet another different error, incompatible save load. looks like engine just produces a random lua error and it would be good if it didnt do that https://github.com/ZeroK-RTS/CrashReports/issues/143589
------- TRUNCATED -------
[t=00:01:52.604422][f=-000001] Error: [PreGame::LoadSaveFile] incompatible save-file specified
[t=00:01:52.621586][f=-000001] [LuaMenuController::Activate(msg="[PreGame] incompatible save-file")] luaMenu=00000202523c0750
[t=00:01:52.621859][f=-000001] SetLobbyButtonEnabled, true
[t=00:01:52.622012][f=-000001] SetLobbyFullscreenMode, 1, 1920, 1080
[t=00:01:52.628593][f=-000001] Error: Spring 2025.04.10 has crashed.
[t=00:01:52.629090][f=-000001] Error: [LuaMenu::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=ActivateMenu trace=[Internal Lua error: Call failure] [string "libs/chiliui/chili/controls/control.lua"]:-1: attempt to call a table value
terminate called after throwing an instance of 'std::system_error'
  • this one seems to be S44: https://github.com/ZeroK-RTS/CrashReports/issues/144346
[t=00:06:03.201377][f=0002861] Error: [LuaRules::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=Update trace=[Internal Lua error: Call failure] [string "LuaRules/Gadgets/unit_morph.lua"]:1497: attempt to call upvalue 'snext' (a nil value)
[t=00:06:03.204277][f=0002861] Error: [LuaRules::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=DrawWorld trace=[Internal Lua error: Call failure] [string "LuaRules/Gadgets/unit_morph.lua"]:1627: attempt to call upvalue 'snext' (a nil value)
[t=00:06:03.216288][f=0002861] Error: [LuaRules::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=DrawWorld trace=[Internal Lua error: Call failure] [string "LuaRules/Gadgets/unit_morph.lua"]:1627: attempt to call upvalue 'snext' (a nil value)
[t=00:06:03.229864][f=0002861] Error: [LuaRules::RunCallInTraceback] error=2 (LUA_ERRRUN) callin=DrawWorld trace=[Internal Lua error: Call failure] [string "LuaRules/Gadgets/unit_morph.lua"]:1627: attempt to call upvalue 'snext' (a nil value)

sprunk avatar Jun 20 '25 01:06 sprunk

A lot of this goes back to Spring.Utilities.GetUnitCost(unitID, unitDefID) potentially being nil for commanders or terraform that have not had a cost UnitRulesParam set.

GoogleFrog avatar Jun 24 '25 04:06 GoogleFrog

Sure, though this appearing now after an engine change and not earlier is a bit worrisome from engine PoV.

sprunk avatar Jun 24 '25 10:06 sprunk

Seems to have been solved along the way.

sprunk avatar Dec 09 '25 17:12 sprunk