Closed Bastrabun closed 1 year ago
In issue #15 you kindly allowed
EDIT: Feel free to @ me when you find such errors if nobody seems to be active.
I feel like this is the case here again, so I do summon thee, @SmallJoker
Thank you very much
@Bastrabun gate_functions.lua:406
does not point to any relevant code (checked 21b5a6c00, March 2021). Please provide a stack backtrace using an unmodified castle_gates version, or provide the failing line contents in case you absolutely need a modification in this file.
This is the affected line: https://github.com/minetest-mods/castle_gates/blob/master/gate_functions.lua#L402 in fc78d92
which reads
castle_gates.trigger_gate(door.all[1].pos, door.all[1].node,
Do you know of any reproduction steps? This seems to be related to hinges only, but I cannot figure out why door.all
would be an empty table.
Unfortunately not. I did not find the user who did it and I wasn't able to reproduce the crash. Also there were no "uncommon" constructions involving hinges to be found.
We have a testserver where we can make any kind of experiments and we can add logging to the mod per your suggestion.
So far, it only happened once, while the castle_gate blocks are used on a daily basis
I suppose this would be the easiest way to find the culprit:
minetest.after(1, function(player_name)
if not door.all[1] then
minetest.log("warning", "HINGE ERROR WITH NODE " .. dump(node) .. ": " .. dump(door.all))
return
end
-- Get current player ObjectRef (nil when gone)
castle_gates.trigger_gate(door.all[1].pos, door.all[1].node,
minetest.get_player_by_name(player_name))
end, player:get_player_name())
Will add and then call a bug bounty on castle gate hinge crashes :D
Same thing just crashed another server, tried to ask for steps to reproduce but not sure if I get anything.
Attempt to index nil @ castle_gates.trigger_gate(door.all[1].pos, door.all[1].node,
(gate_functions.lua:441).
seems like using an already moving castle_gates:steel_portcullis_bars caused this one.
Didn't try and didn't read code that carefully but makes sense if it causes "double trigger" for trigger_gate function and leaves door.all
empty (which also seems very much possible).
Yes, using (right-clicking/placing) a gate node while the gate is already moving can trigger the crash. Rapidly clicking a gate segment that has multiple voxels to move triggers it reliably.
@Bastrabun should be fixed now
@Bastrabun should be fixed now
I guess this almost sure also fixes case where gate is activated rapidly multiple times presumably caused by before core.after(1, xyz)
had chance to actually run resulting in multiple consecutive jobs for same pos.
I guess multiple jobs can still be queued? But it just wont finish those anymore.
I mean issue that was temporarily fixed on pandorabox by switching to https://github.com/S-S-X/castle_gates/commit/818a204b9f38048b5099c45b23c495f3cb3efc29 because it was already more like public server restart button than rare bug crashing server.
edit. I mean Lua error, not crashing server but raising an error that removes server from existence.
Do you have a surefire repro so I could test with and without the fix?
Fixed in https://github.com/minetest-mods/castle_gates/commit/c4316a082159d6a4977faaab1bf2cb38d854c97d (cannot reproduced anymore)
Not sure what was attempted by the user.
For my reference 897