minetest-mods / castle_gates

Large swinging and sliding gate components suitable for a castle
MIT License
9 stars 8 forks source link

Some kind of crash #9

Closed VanessaE closed 5 years ago

VanessaE commented 5 years ago

One of my users reported this:

[10-03 09:32] User11@VBld VanessaE: Portcullis Bars cause [VE-Creative] to crash. ...later... [10-03 14:12] User11@VBld when you touch portcullisbars on [VE-Creative,] the server crashes...

Here's what I find in my logs related to it:

2018-10-03 15:28:57: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback item_OnPlace(): ...ods/dreambuilder_modpack/castle_gates/gate_functions.lua:16: attempt to index field 'top' (a nil value)
2018-10-03 15:28:57: ERROR[Main]: stack traceback:
2018-10-03 15:28:57: ERROR[Main]:       ...ods/dreambuilder_modpack/castle_gates/gate_functions.lua:16: in function 'get_dirs'
2018-10-03 15:28:57: ERROR[Main]:       ...ods/dreambuilder_modpack/castle_gates/gate_functions.lua:157: in function 'get_door_layout'
2018-10-03 15:28:57: ERROR[Main]:       ...ods/dreambuilder_modpack/castle_gates/gate_functions.lua:321: in function 'on_rightclick'
2018-10-03 15:28:57: ERROR[Main]:       /usr/local/share/minetest/builtin/game/item.lua:423: in function </usr/local/share/minetest/builtin/game/item.lua:416>

From what I gather, the person above who triggered the crash is not the same person who placed the offending gate, if that matters.

cheapie commented 5 years ago

This seems to be triggered when trying to interact with a gate that has a param2 value greater than 23.

VanessaE commented 5 years ago

My best guess here is that the gate got the wrong param2 value due to a bug in unified dyes (which incorrectly modified param2 on nodes that didn't need it). I have since fixed that particular bug, but this bug in the gates still exists. It's just harder to trigger :smiley:

FaceDeer commented 5 years ago

I've added a couple of sanity checks that will cause door nodes with bad param2s to be ignored rather than crashing. That should prevent something like this from happening again.