Server crashes when attacking mobs #2

Closed
opened 2024-03-28 18:57:40 +01:00 by migrationbot · 4 comments

Author: MatthiasZM96

Sometimes, when attacking mobs, apparently when we get damage from mobs and at the same time attack them, we get server crashes that come from the "electric saber" function I believe.

Here is the full debug output before the server crash:

2024-02-07 05:26:29: ACTION[Server]: player LadyRec (id=21842, hp=20) punched LuaEntitySAO "mobs_mc:zombie" at (168,-39,1) (id=42603, hp=20), damage=0
2024-02-07 05:26:30: ACTION[Server]: --- Bug report start (please provide a few lines before this also for context) ---
2024-02-07 05:26:30: ACTION[Server]: Error: "\"Runtime error from mod 'industrialtest' in callback on_punchplayer(): ...t/.minetest/mods/industrialtest/tools/electric_saber.lua:164: attempt to index global 'registeredElectricSabers' (a nil value)\
stack traceback:\
\9...t/.minetest/mods/industrialtest/tools/electric_saber.lua:164: in function <...t/.minetest/mods/industrialtest/tools/electric_saber.lua:162>\
\9/usr/share/minetest/builtin/common/register.lua:26: in function </usr/share/minetest/builtin/common/register.lua:12>\
\9[C]: in function 'punch'\
\9...etest/games/mineclone2/mods/ENTITIES/mcl_mobs/combat.lua:1135: in function 'do_states_attack'\
\9...minetest/games/mineclone2/mods/ENTITIES/mcl_mobs/api.lua:333: in function 'do_states'\
\9...minetest/games/mineclone2/mods/ENTITIES/mcl_mobs/api.lua:445: in function <...minetest/games/mineclone2/mods/ENTITIES/mcl_mobs/api.lua:375>\
\9[C]: in function 'pcall'\
\9...minetest/games/mineclone2/mods/ENTITIES/mcl_mobs/api.lua:493: in function 'on_step_old'\
\9...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:24: in function <...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:23>\""
2024-02-07 05:26:30: ACTION[Server]: Bug info: {
	y = -39.210994720459,
	x = 168.40803527832,
	z = 1.1029992103577
}
2024-02-07 05:26:30: ACTION[Server]: Bug info additional: {
	env_damage_timer = 0.9500000141561,
	health = 3.8,
	_void_timer = 0.40000000596046,
	_check_aggro_timer = 2.0000000298023,
	nametag = "",
	selectionbox = {
		-0.3,
		-0.01,
		-0.3,
		0.3,
		1.8,
		0.3
	},
	texture_selected = 1,
	time_of_day = 0.67812502384186,
	state = "attack",
	frame_speed_multiplier = 1,
	old_health = 3.8,
	_kb_turn = false,
	acc = {
		y = 0,
		x = 0,
		z = 0
	},
	despawn_immediately = false,
	invul_timestamp = 167531196252,
	xp_timestamp = 167531196252,
	_jumping_cliff = true,
	suffocation_timer = 0,
	standing_under = "air",
	_aggro = true,
	breath = -1,
	jump_count = 0,
	texture_mods = {
		"^[colorize:#d42222:175"
	},
	base_colbox = {
		-0.3,
		-0.01,
		-0.3,
		0.3,
		1.8,
		0.3
	},
	_locked_object = userdata: 0x4567f068,
	nametag2 = "",
	base_size = {
		y = 1,
		x = 1
	},
	base_mesh = "mobs_mc_zombie.b3d",
	base_selbox = {
		-0.3,
		-0.01,
		-0.3,
		0.3,
		1.8,
		0.3
	},
	_run_armor_init = true,
	old_y = -39.48999786377,
	facing_fence = false,
	_timers = {
		onstep_dostates = 0.35000000521541,
		onstep_occassional = 0.85000001266599,
		step_look_for_someone = 0,
		onstep_engage = 0.050000000745058
	},
	opinion_sound_cooloff = 1,
	mesh = "mobs_mc_zombie.b3d",
	_can_jump_cliff = false,
	delay = -0.9,
	lifetimer = 30.779999598414,
	is_mob = true,
	_current_animation = "punch",
	collisionbox = {
		-0.3,
		-0.01,
		-0.3,
		0.3,
		1.8,
		0.3
	},
	object = userdata: 0x4589d710,
	pause_timer = -3.7252902984619e-09,
	attack = userdata: 0x4567f068,
	standing_on = "mcl_mobspawners:spawner",
	textures = {
		"blank.png",
		"mobs_mc_zombie.png"
	},
	base_texture = {
		"blank.png",
		"mobs_mc_zombie.png"
	},
	blinktimer = 0,
	armor_list = {
		helmet = "",
		boots = "",
		chestplate = "",
		leggings = ""
	},
	path = {
		stuck = false,
		following = false,
		way = {
			{
				y = -40,
				x = 167,
				z = 1
			},
			{
				y = -40,
				x = 167,
				z = 2
			},
			{
				y = -40,
				x = 168,
				z = 2
			},
			{
				y = -40,
				x = 169,
				z = 2
			}
		},
		lastpos = {
			y = -39.032997131348,
			x = 168.33703613281,
			z = 1.0369992256165
		},
		stuck_timer = 0
	},
	jump_sound_cooloff = -7.4505805969238e-09,
	blinkstatus = false,
	v_start = false,
	timer = 0,
	standing_in = "air",
	_turn_to = 5.7165334316444,
	target_yaw = 5.5631656646729
}
2024-02-07 05:26:30: ACTION[Server]: --- Bug report end ---

Then, after a few seconds, the server crash:

2024-02-07 05:26:47: ACTION[Main]: Server: Shutting down
2024-02-07 05:26:47: ACTION[Main]: [doc] Server shuts down. Player data is about to be saved.
2024-02-07 05:26:47: ACTION[Main]: [doc] Wrote player data into /home/minetest/.minetest/worlds/Bonjour/doc.mt.
2024-02-07 05:26:48: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'industrialtest' in callback luaentity_Step(): "Runtime error from mod 'industrialtest' in callback on_punchplayer(): ...t/.minetest/mods/industrialtest/tools/electric_saber.lua:164: attempt to index globa
2024-02-07 05:26:48: ERROR[Main]: l 'registeredElectricSabers' (a nil value)
2024-02-07 05:26:48: ERROR[Main]: stack traceback:
2024-02-07 05:26:48: ERROR[Main]: 	...t/.minetest/mods/industrialtest/tools/electric_saber.lua:164: in function <...t/.minetest/mods/industrialtest/tools/electric_saber.lua:162>
2024-02-07 05:26:48: ERROR[Main]: 	/usr/share/minetest/builtin/common/register.lua:26: in function </usr/share/minetest/builtin/common/register.lua:12>
2024-02-07 05:26:48: ERROR[Main]: 	[C]: in function 'punch'
2024-02-07 05:26:48: ERROR[Main]: 	....minetest/games/mineclone2/mods/ITEMS/mcl_bows/arrow.lua:260: in function 'on_step_old'
2024-02-07 05:26:48: ERROR[Main]: 	...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:24: in function <...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:23>"
2024-02-07 05:26:48: ERROR[Main]: stack traceback:
2024-02-07 05:26:48: ERROR[Main]: 	[C]: in function 'punch'
2024-02-07 05:26:48: ERROR[Main]: 	....minetest/games/mineclone2/mods/ITEMS/mcl_bows/arrow.lua:260: in function 'on_step_old'
2024-02-07 05:26:48: ERROR[Main]: 	...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:24: in function <...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:23>

Can you look into it please? This time when the player that caused the bug tries to log back in, it crashes again :(

**Author: MatthiasZM96** Sometimes, when attacking mobs, apparently when we get damage from mobs and at the same time attack them, we get server crashes that come from the "electric saber" function I believe. Here is the full debug output before the server crash: ``` 2024-02-07 05:26:29: ACTION[Server]: player LadyRec (id=21842, hp=20) punched LuaEntitySAO "mobs_mc:zombie" at (168,-39,1) (id=42603, hp=20), damage=0 2024-02-07 05:26:30: ACTION[Server]: --- Bug report start (please provide a few lines before this also for context) --- 2024-02-07 05:26:30: ACTION[Server]: Error: "\"Runtime error from mod 'industrialtest' in callback on_punchplayer(): ...t/.minetest/mods/industrialtest/tools/electric_saber.lua:164: attempt to index global 'registeredElectricSabers' (a nil value)\ stack traceback:\ \9...t/.minetest/mods/industrialtest/tools/electric_saber.lua:164: in function <...t/.minetest/mods/industrialtest/tools/electric_saber.lua:162>\ \9/usr/share/minetest/builtin/common/register.lua:26: in function </usr/share/minetest/builtin/common/register.lua:12>\ \9[C]: in function 'punch'\ \9...etest/games/mineclone2/mods/ENTITIES/mcl_mobs/combat.lua:1135: in function 'do_states_attack'\ \9...minetest/games/mineclone2/mods/ENTITIES/mcl_mobs/api.lua:333: in function 'do_states'\ \9...minetest/games/mineclone2/mods/ENTITIES/mcl_mobs/api.lua:445: in function <...minetest/games/mineclone2/mods/ENTITIES/mcl_mobs/api.lua:375>\ \9[C]: in function 'pcall'\ \9...minetest/games/mineclone2/mods/ENTITIES/mcl_mobs/api.lua:493: in function 'on_step_old'\ \9...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:24: in function <...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:23>\"" 2024-02-07 05:26:30: ACTION[Server]: Bug info: { y = -39.210994720459, x = 168.40803527832, z = 1.1029992103577 } 2024-02-07 05:26:30: ACTION[Server]: Bug info additional: { env_damage_timer = 0.9500000141561, health = 3.8, _void_timer = 0.40000000596046, _check_aggro_timer = 2.0000000298023, nametag = "", selectionbox = { -0.3, -0.01, -0.3, 0.3, 1.8, 0.3 }, texture_selected = 1, time_of_day = 0.67812502384186, state = "attack", frame_speed_multiplier = 1, old_health = 3.8, _kb_turn = false, acc = { y = 0, x = 0, z = 0 }, despawn_immediately = false, invul_timestamp = 167531196252, xp_timestamp = 167531196252, _jumping_cliff = true, suffocation_timer = 0, standing_under = "air", _aggro = true, breath = -1, jump_count = 0, texture_mods = { "^[colorize:#d42222:175" }, base_colbox = { -0.3, -0.01, -0.3, 0.3, 1.8, 0.3 }, _locked_object = userdata: 0x4567f068, nametag2 = "", base_size = { y = 1, x = 1 }, base_mesh = "mobs_mc_zombie.b3d", base_selbox = { -0.3, -0.01, -0.3, 0.3, 1.8, 0.3 }, _run_armor_init = true, old_y = -39.48999786377, facing_fence = false, _timers = { onstep_dostates = 0.35000000521541, onstep_occassional = 0.85000001266599, step_look_for_someone = 0, onstep_engage = 0.050000000745058 }, opinion_sound_cooloff = 1, mesh = "mobs_mc_zombie.b3d", _can_jump_cliff = false, delay = -0.9, lifetimer = 30.779999598414, is_mob = true, _current_animation = "punch", collisionbox = { -0.3, -0.01, -0.3, 0.3, 1.8, 0.3 }, object = userdata: 0x4589d710, pause_timer = -3.7252902984619e-09, attack = userdata: 0x4567f068, standing_on = "mcl_mobspawners:spawner", textures = { "blank.png", "mobs_mc_zombie.png" }, base_texture = { "blank.png", "mobs_mc_zombie.png" }, blinktimer = 0, armor_list = { helmet = "", boots = "", chestplate = "", leggings = "" }, path = { stuck = false, following = false, way = { { y = -40, x = 167, z = 1 }, { y = -40, x = 167, z = 2 }, { y = -40, x = 168, z = 2 }, { y = -40, x = 169, z = 2 } }, lastpos = { y = -39.032997131348, x = 168.33703613281, z = 1.0369992256165 }, stuck_timer = 0 }, jump_sound_cooloff = -7.4505805969238e-09, blinkstatus = false, v_start = false, timer = 0, standing_in = "air", _turn_to = 5.7165334316444, target_yaw = 5.5631656646729 } 2024-02-07 05:26:30: ACTION[Server]: --- Bug report end --- ``` Then, after a few seconds, the server crash: ``` 2024-02-07 05:26:47: ACTION[Main]: Server: Shutting down 2024-02-07 05:26:47: ACTION[Main]: [doc] Server shuts down. Player data is about to be saved. 2024-02-07 05:26:47: ACTION[Main]: [doc] Wrote player data into /home/minetest/.minetest/worlds/Bonjour/doc.mt. 2024-02-07 05:26:48: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'industrialtest' in callback luaentity_Step(): "Runtime error from mod 'industrialtest' in callback on_punchplayer(): ...t/.minetest/mods/industrialtest/tools/electric_saber.lua:164: attempt to index globa 2024-02-07 05:26:48: ERROR[Main]: l 'registeredElectricSabers' (a nil value) 2024-02-07 05:26:48: ERROR[Main]: stack traceback: 2024-02-07 05:26:48: ERROR[Main]: ...t/.minetest/mods/industrialtest/tools/electric_saber.lua:164: in function <...t/.minetest/mods/industrialtest/tools/electric_saber.lua:162> 2024-02-07 05:26:48: ERROR[Main]: /usr/share/minetest/builtin/common/register.lua:26: in function </usr/share/minetest/builtin/common/register.lua:12> 2024-02-07 05:26:48: ERROR[Main]: [C]: in function 'punch' 2024-02-07 05:26:48: ERROR[Main]: ....minetest/games/mineclone2/mods/ITEMS/mcl_bows/arrow.lua:260: in function 'on_step_old' 2024-02-07 05:26:48: ERROR[Main]: ...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:24: in function <...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:23>" 2024-02-07 05:26:48: ERROR[Main]: stack traceback: 2024-02-07 05:26:48: ERROR[Main]: [C]: in function 'punch' 2024-02-07 05:26:48: ERROR[Main]: ....minetest/games/mineclone2/mods/ITEMS/mcl_bows/arrow.lua:260: in function 'on_step_old' 2024-02-07 05:26:48: ERROR[Main]: ...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:24: in function <...mes/mineclone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:23> ``` Can you look into it please? This time when the player that caused the bug tries to log back in, it crashes again :(
Author

Author: mrkubax10

7df191097d should fix this issue.

**Author: mrkubax10** 7df191097d should fix this issue.
Author

Author: MatthiasZM96

I've re-enabled the mod and applied the fix, it seems to be OK, but it didn't happen consistently. I'll let you know in a while if the problem still occurs.

Thanks a lot!

**Author: MatthiasZM96** I've re-enabled the mod and applied the fix, it seems to be OK, but it didn't happen consistently. I'll let you know in a while if the problem still occurs. Thanks a lot!
Author

Author: mrkubax10

Thanks a lot!

You're welcome. Feel free to reopen the issue if the problem happens. I didn't intent to close it but the Gitea auto-close feature did that so ¯\_(ツ)_/¯

**Author: mrkubax10** > Thanks a lot! You're welcome. Feel free to reopen the issue if the problem happens. I didn't intent to close it but the Gitea auto-close feature did that so ¯\\\_(ツ)\_/¯
Author

Closed by mrkubax10

**Closed by mrkubax10**
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrkubax10/industrialtest#2
No description provided.