Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid vector.add crashes server #608

Closed
appgurueu opened this issue Apr 27, 2022 · 7 comments
Closed

Invalid vector.add crashes server #608

appgurueu opened this issue Apr 27, 2022 · 7 comments
Labels

Comments

@appgurueu
Copy link

appgurueu commented Apr 27, 2022

See minetest-mods/wielded_light#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>
@TurkeyMcMac
Copy link
Contributor

@debagos Did you have any other mods enabled that used mesecons?

@debagos
Copy link

debagos commented Apr 30, 2022

@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

@TurkeyMcMac
Copy link
Contributor

TurkeyMcMac commented Apr 30, 2022

Could you provide ZIP archives of the mods you didn't get on ContentDB?

@debagos
Copy link

debagos commented Apr 30, 2022

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?

@TurkeyMcMac
Copy link
Contributor

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.

@numberZero
Copy link
Contributor

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.

@numberZero
Copy link
Contributor

See also #637.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants