pandorabox-io / pandorabox.io

Pandorabox infrastructure code
https://pandorabox.io
31 stars 4 forks source link

digtron crash (caused by the illumination mod) #363

Closed thomasrudin closed 4 years ago

thomasrudin commented 4 years ago
minetest_1           | 2019-11-25 12:01:38: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod '' in callback environment_Step(): /data/world//worldmods/digtron/util.lua:55: attempt to call field 'can_dig' (a boolean value)
minetest_1           | 2019-11-25 12:01:38: ERROR[Main]: stack traceback:
minetest_1           | 2019-11-25 12:01:38: ERROR[Main]:    /data/world//worldmods/digtron/util.lua:55: in function 'execute_dig'
minetest_1           | 2019-11-25 12:01:38: ERROR[Main]:    /data/world//worldmods/digtron/util_execute_cycle.lua:151: in function 'f'
minetest_1           | 2019-11-25 12:01:38: ERROR[Main]:    .../worldmods/monitoring/monitoring/metrictypes/counter.lua:39: in function 'execute_dig_cycle'
minetest_1           | 2019-11-25 12:01:38: ERROR[Main]:    /data/world//worldmods/digtron/nodes/node_controllers.lua:148: in function 'func'
minetest_1           | 2019-11-25 12:01:38: ERROR[Main]:    /usr/local/share/minetest/builtin/common/after.lua:20: in function 'globalstep'
minetest_1           | 2019-11-25 12:01:38: ERROR[Main]:    ...//worldmods/monitoring/monitoring/builtin/globalstep.lua:29: in function <...//worldmods/monitoring/monitoring/builtin/globalstep.lua:20>
minetest_1           | 2019-11-25 12:01:38: ERROR[Main]:    /usr/local/share/minetest/builtin/game/register.lua:429: in function </usr/local/share/minetest/builtin/game/register.lua:413>
OgelGames commented 4 years ago

Interestingly, this crash was not due to an error in the digtron code, but in the illumination mod.

The logic of the code is perfectly fine, and follows the standard convention of can_dig being a function, as it is in the developer wiki.

The issue with the illumination mod, is this line, which improperly makes the node not diggable. The correct way to do this is either with a function that always returns false, or by defining diggable = false.

By the way, if you're wondering how I found this, I did a search through all the mods' files looking for "can_dig = false", and the illumination mod was (thankfully) the only place it was found. Also I was able to precisely replicate the crash by standing in front of a digtron while holding a light-emitting node :wink:

thomasrudin commented 4 years ago

Nice find :+1: , i don't think @PiezoU005F is active in minetest anymore... :disappointed: https://notabug.org/Piezo_/minetest-illumination/issues/1

Next steps would be forking and fixing of the mod i guess, feel free to contact me if you want access to the org and/or fix that issue..

OgelGames commented 4 years ago

i don't think @PiezoU005F is active in minetest anymore...

Yeah I kinda figured that...

Next steps would be forking and fixing of the mod

Yes, it would probably be easier if I forked it, as there are quite a few places I think the code could be improved, and I also think I'll need to make some other changes to make #366 possible.

OgelGames commented 4 years ago

Now I know what you meant by access to the org... :smile: So now I fork it to a Pandorabox repo?

thomasrudin commented 4 years ago

So now I fork it to a Pandorabox repo?

sure, sounds good :+1:

There aren't really any guidelinies as of what belongs into the pandorabox-io repo but i use it for server-specific mods and the likes :smile: