Closed VorTechnix closed 1 month ago
Interesting, I wasn't aware pcall
was allowed in the Minetest sandbox. Yeah, we should probably do this, though we'd also need to pay special attention to error handling to make sure we don't obscure errors.
Traditionally I've tried to avoid all crashes in the command code themselves, but I do agree a level of protection here -- if implemented correctly -- would significantly improve WEA's stability.
I'll take a look at this, but the next few days are extremely busy so it may have to wait until next week.
Interesting, I wasn't aware pcall was allowed in the Minetest sandbox.
I've used it in a few places and minetest seems fine with it. I temporarily patched the crash on my branch by locally implementing the change I suggested. So pcall seems to work in minetest today. 🤷♂️
Nice. What happens if there is a crash though in the parsing function? What is the effect of that?
A nice trace-back message in the player chat
hmmmmmm error message is quite opaque tho probably worth implementing some extra logic there
okay, I can take care of that - it shouldn't be complicated
Thanks for looking into it!
Make sure to protect the main chat command function calls as well... just in case.
Fixed in #123
https://github.com/sbrl/Minetest-WorldEditAdditions/blob/269a73be48ddec8fc9946cbef847e6ccef138a9e/worldeditadditions_core/core/run_command.lua#L115
If the
options.parse
function of a chat command blows up when given a certain input the game crashes. This could take down a server for no reason, with no warning and no chance to save current state. Everything inwea_core
should fail safe soshould be changed to
TODO: Look for other instances in WEA core where calls should be protected.