mesecons
mesecons copied to clipboard
Invalid `vector.add` crashes server
See https://github.com/minetest-mods/wielded_light/issues/21:
ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'wielded_light' in callback environment_Step(): ...i/github/minetest-5.5.0/bin/../builtin/common/vector.lua:154: attempt to perform arithmetic on field 'x' (a nil value)
ERROR[Main]: stack traceback:
ERROR[Main]: ...i/github/minetest-5.5.0/bin/../builtin/common/vector.lua:154: in function 'add'
ERROR[Main]: ...ub/minetest-5.5.0/bin/../mods/mesecons/mesecons/init.lua:98: in function <...ub/minetest-5.5.0/bin/../mods/mesecons/mesecons/init.lua:93>
ERROR[Main]: ...test-5.5.0/bin/../mods/mesecons/mesecons/actionqueue.lua:137: in function 'execute'
ERROR[Main]: ...test-5.5.0/bin/../mods/mesecons/mesecons/actionqueue.lua:111: in function <...test-5.5.0/bin/../mods/mesecons/mesecons/actionqueue.lua:73>
ERROR[Main]: ...i/github/minetest-5.5.0/bin/../builtin/game/register.lua:425: in function <...i/github/minetest-5.5.0/bin/../builtin/game/register.lua:409>
@debagos Did you have any other mods enabled that used mesecons?
@TurkeyMcMac Plenty:
awards, cannons, christmas_decor, digilines, ezmod_nodes, fireworkz, handdryer, handle_schematics, homedecor, laptop, led_marquee, morelights, nether, nuke, particlefountain, pipeworks, soccer, technic, terumet, travelnet, unified_inventory, unifieddyes, xdecor, WorldEdit
Could you provide ZIP archives of the mods you didn't get on ContentDB?
I doubt that will help. Most of these mods are running like that for over a year now. But a while ago I used a bugged LuaJIT version which caused SIGSEGV and I think there is some broken (meta)data now. So I think the job is done with adding some NiL checks?
The stack trace suggests that a function was passed a position that was not nil but whose x field was nil. I thought this might be due to invalid usage of the API in some rare case, but it could be due to data corruption. If the interpreter is bugged, you never know.
Not our bug. Someone had to pass that invalid vector to Mesecons.
Now, intercepting invalid arguments at API level (mesecon.receptor_off in this case) is possible. It is also possible to copy the arguments there to avoid pass-by-reference surprises (it’s sad Lua lacks immutable types). But that’d be a feature, not a bugfix.
See also #637.