SwissalpS / postool

minetest mod to show grid of current map-block (also HUD of position in space and time)
GNU Lesser General Public License v3.0
3 stars 4 forks source link

nil related crash in `huds.lua` #14

Closed BuckarooBanzay closed 2 years ago

BuckarooBanzay commented 3 years ago

(i haven't looked at this one in detail yet)

2021-05-23 22:42:06: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'afkkick' in callback environment_Step(): /data/world//worldmods/postool/huds.lua:18: attempt to call method 'get_meta' (a nil value)
2021-05-23 22:42:06: ERROR[Main]: stack traceback:
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/postool/huds.lua:18: in function 'readPlayerToggles'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/postool/huds.lua:381: in function 'initHud'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/postool/huds.lua:153: in function 'getPlayerTables'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/postool/huds.lua:66: in function 'playerWantsChunkIndicator'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/postool/tool.lua:76: in function 'on_use'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/pipeworks/wielder.lua:328: in function 'act'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/pipeworks/wielder.lua:111: in function 'wielder_on'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/pipeworks/wielder.lua:147: in function 'old_action_on'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/mesecons_ratelimiter/api.lua:36: in function 'f'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/monitoring/metrictypes/counter.lua:42: in function 'action_on'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/mesecons/mesecons/internal.lua:190: in function </data/world//worldmods/mesecons/mesecons/internal.lua:183>
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/mesecons/mesecons/actionqueue.lua:137: in function 'old_execute'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/mesecons_debug/overrides.lua:7: in function 'f'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/monitoring/metrictypes/counter.lua:42: in function 'execute'
2021-05-23 22:42:06: ERROR[Main]:   /data/world//worldmods/mesecons/mesecons/actionqueue.lua:111: in function </data/world//worldmods/mesecons/mesecons/actionqueue.lua:73>
2021-05-23 22:42:06: ERROR[Main]:   /usr/local/share/minetest/builtin/game/register.lua:422: in function </usr/local/share/minetest/builtin/game/register.lua:406>
2021-05-23 22:42:06: ERROR[Main]: stack traceback:

EDIT: the tool was used in a node-breaker, right? :facepalm:

SwissalpS commented 2 years ago

I have still not been able to reproduce this. My tests work fine in node breaker, deployer and postool can't be set in digtron. Have also tested in constructor without errors.

edit: also triggering with luac and dead player does not trigger any errors.

BuckarooBanzay commented 2 years ago

Hmm, it didn't happen after that :shrug: closing for the sake of sanity :slightly_smiling_face:

BuckarooBanzay commented 2 years ago

Hm, i think i remember again how this could happen: Did you test it with a node-breaker/deployer and logging out afterwards? The oPlayer object might come from here: https://github.com/mt-mods/pipeworks/blob/23fe215721a816d49652f4523c9ff6458b010b4b/common.lua#L176-L290 And it does not have the get_meta field...

SwissalpS commented 2 years ago

Thanks. :D Yes it seems to happen if the player who set up the node-breaker is offline. I found a way to make it work, so that the grid shows up and there is no crash. Also found something else to improve.