Crash in mcl_experience #954

Closed
opened 2021-01-04 20:03:26 +01:00 by LizzyFleckenstein03 · 9 comments
2021-01-04 20:08:05: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '??' in callback luaentity_Step(): /usr/share/minetest/builtin/common/vector.lua:98: attempt to perform arithmetic on local 'b' (a nil value)
2021-01-04 20:08:05: ERROR[Main]: stack traceback:
2021-01-04 20:08:05: ERROR[Main]:       /usr/share/minetest/builtin/common/vector.lua:98: in function 'add'
2021-01-04 20:08:05: ERROR[Main]:       ...netest/games/MineClone2/mods/HUD/mcl_experience/init.lua:334: in function 'xp_step'
2021-01-04 20:08:05: ERROR[Main]:       ...netest/games/MineClone2/mods/HUD/mcl_experience/init.lua:552: in function 'func'
2021-01-04 20:08:05: ERROR[Main]:       /usr/share/minetest/builtin/profiler/instrumentation.lua:106: in function 'on_step_old'
2021-01-04 20:08:05: ERROR[Main]:       ...mes/MineClone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:17: in function 'func'
2021-01-04 20:08:05: ERROR[Main]:       /usr/share/minetest/builtin/profiler/instrumentation.lua:106: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:100>
``` 2021-01-04 20:08:05: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '??' in callback luaentity_Step(): /usr/share/minetest/builtin/common/vector.lua:98: attempt to perform arithmetic on local 'b' (a nil value) 2021-01-04 20:08:05: ERROR[Main]: stack traceback: 2021-01-04 20:08:05: ERROR[Main]: /usr/share/minetest/builtin/common/vector.lua:98: in function 'add' 2021-01-04 20:08:05: ERROR[Main]: ...netest/games/MineClone2/mods/HUD/mcl_experience/init.lua:334: in function 'xp_step' 2021-01-04 20:08:05: ERROR[Main]: ...netest/games/MineClone2/mods/HUD/mcl_experience/init.lua:552: in function 'func' 2021-01-04 20:08:05: ERROR[Main]: /usr/share/minetest/builtin/profiler/instrumentation.lua:106: in function 'on_step_old' 2021-01-04 20:08:05: ERROR[Main]: ...mes/MineClone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:17: in function 'func' 2021-01-04 20:08:05: ERROR[Main]: /usr/share/minetest/builtin/profiler/instrumentation.lua:106: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:100> ```
LizzyFleckenstein03 added the
bug
#P1 CRITICAL
labels 2021-01-04 20:03:26 +01:00
Contributor

Thanks, I didn't get to report that in time but I bumped into that issue about an hour ago when I wanted to try the latest commits. :)

My game crashed when I was mining coal, then I joined kay27's server and the server kept crashing when I killed a wolf or tried to pick up XP from fishing. And there was another player, so that was probably another "crash source".

Thanks, I didn't get to report that in time but I bumped into that issue about an hour ago when I wanted to try the latest commits. :) My game crashed when I was mining coal, then I joined kay27's server and the server kept crashing when I killed a wolf or tried to pick up XP from fishing. And there was another player, so that was probably another "crash source".
Member
2021-01-04 20:08:05: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '??' in callback luaentity_Step(): /usr/share/minetest/builtin/common/vector.lua:98: attempt to perform arithmetic on local 'b' (a nil value)
2021-01-04 20:08:05: ERROR[Main]: stack traceback:
2021-01-04 20:08:05: ERROR[Main]:       /usr/share/minetest/builtin/common/vector.lua:98: in function 'add'
2021-01-04 20:08:05: ERROR[Main]:       ...netest/games/MineClone2/mods/HUD/mcl_experience/init.lua:334: in function 'xp_step'
2021-01-04 20:08:05: ERROR[Main]:       ...netest/games/MineClone2/mods/HUD/mcl_experience/init.lua:552: in function 'func'
2021-01-04 20:08:05: ERROR[Main]:       /usr/share/minetest/builtin/profiler/instrumentation.lua:106: in function 'on_step_old'
2021-01-04 20:08:05: ERROR[Main]:       ...mes/MineClone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:17: in function 'func'
2021-01-04 20:08:05: ERROR[Main]:       /usr/share/minetest/builtin/profiler/instrumentation.lua:106: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:100>

This is due to your earlier commit:
cfc86bcf3d

It also causes crashes when trying to sleep & eat; reverting your change fixes the crashes in all 3 mods as expected.

Attempting to sleep in beds crash:

2021-01-04 13:51:26: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mcl_tools' in callback item_OnPlace(): /usr/share/minetest/builtin/common/vector.lua:22: attempt to index local 'v' (a nil value)
2021-01-04 13:51:26: ERROR[Main]: stack traceback:
2021-01-04 13:51:26: ERROR[Main]: 	/usr/share/minetest/builtin/common/vector.lua:22: in function 'length'
2021-01-04 13:51:26: ERROR[Main]: 	...etest/games/mineclone2/mods/ITEMS/mcl_beds/functions.lua:95: in function 'lay_down'
2021-01-04 13:51:26: ERROR[Main]: 	...etest/games/mineclone2/mods/ITEMS/mcl_beds/functions.lua:338: in function 'on_rightclick'
2021-01-04 13:51:26: ERROR[Main]: 	...c/.minetest/games/mineclone2/mods/ITEMS/mcl_beds/api.lua:148: in function 'on_rightclick'
2021-01-04 13:51:26: ERROR[Main]: 	/usr/share/minetest/builtin/game/item.lua:426: in function </usr/share/minetest/builtin/game/item.lua:419>

Trying to eat crash:

2021-01-04 13:52:55: ACTION[Server]: singleplayer activates mcl_core:apple
2021-01-04 13:52:55: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mcl_core' in callback item_OnSecondaryUse(): /usr/share/minetest/builtin/common/vector.lua:94: attempt to index local 'a' (a nil value)
2021-01-04 13:52:55: ERROR[Main]: stack traceback:
2021-01-04 13:52:55: ERROR[Main]: 	/usr/share/minetest/builtin/common/vector.lua:94: in function 'add'
2021-01-04 13:52:55: ERROR[Main]: 	...etest/games/mineclone2/mods/PLAYER/mcl_hunger/hunger.lua:160: in function 'eat'
2021-01-04 13:52:55: ERROR[Main]: 	...etest/games/mineclone2/mods/PLAYER/mcl_hunger/hunger.lua:44: in function <...etest/games/mineclone2/mods/PLAYER/mcl_hunger/hunger.lua:6>
> ``` > 2021-01-04 20:08:05: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '??' in callback luaentity_Step(): /usr/share/minetest/builtin/common/vector.lua:98: attempt to perform arithmetic on local 'b' (a nil value) > 2021-01-04 20:08:05: ERROR[Main]: stack traceback: > 2021-01-04 20:08:05: ERROR[Main]: /usr/share/minetest/builtin/common/vector.lua:98: in function 'add' > 2021-01-04 20:08:05: ERROR[Main]: ...netest/games/MineClone2/mods/HUD/mcl_experience/init.lua:334: in function 'xp_step' > 2021-01-04 20:08:05: ERROR[Main]: ...netest/games/MineClone2/mods/HUD/mcl_experience/init.lua:552: in function 'func' > 2021-01-04 20:08:05: ERROR[Main]: /usr/share/minetest/builtin/profiler/instrumentation.lua:106: in function 'on_step_old' > 2021-01-04 20:08:05: ERROR[Main]: ...mes/MineClone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:17: in function 'func' > 2021-01-04 20:08:05: ERROR[Main]: /usr/share/minetest/builtin/profiler/instrumentation.lua:106: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:100> > ``` This is due to your earlier commit: https://git.minetest.land/Wuzzy/MineClone2/commit/cfc86bcf3dc273c217b1c26d935e12d5e682348f It also causes crashes when trying to sleep & eat; reverting your change fixes the crashes in all 3 mods as expected. Attempting to sleep in beds crash: ``` 2021-01-04 13:51:26: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mcl_tools' in callback item_OnPlace(): /usr/share/minetest/builtin/common/vector.lua:22: attempt to index local 'v' (a nil value) 2021-01-04 13:51:26: ERROR[Main]: stack traceback: 2021-01-04 13:51:26: ERROR[Main]: /usr/share/minetest/builtin/common/vector.lua:22: in function 'length' 2021-01-04 13:51:26: ERROR[Main]: ...etest/games/mineclone2/mods/ITEMS/mcl_beds/functions.lua:95: in function 'lay_down' 2021-01-04 13:51:26: ERROR[Main]: ...etest/games/mineclone2/mods/ITEMS/mcl_beds/functions.lua:338: in function 'on_rightclick' 2021-01-04 13:51:26: ERROR[Main]: ...c/.minetest/games/mineclone2/mods/ITEMS/mcl_beds/api.lua:148: in function 'on_rightclick' 2021-01-04 13:51:26: ERROR[Main]: /usr/share/minetest/builtin/game/item.lua:426: in function </usr/share/minetest/builtin/game/item.lua:419> ``` Trying to eat crash: ``` 2021-01-04 13:52:55: ACTION[Server]: singleplayer activates mcl_core:apple 2021-01-04 13:52:55: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mcl_core' in callback item_OnSecondaryUse(): /usr/share/minetest/builtin/common/vector.lua:94: attempt to index local 'a' (a nil value) 2021-01-04 13:52:55: ERROR[Main]: stack traceback: 2021-01-04 13:52:55: ERROR[Main]: /usr/share/minetest/builtin/common/vector.lua:94: in function 'add' 2021-01-04 13:52:55: ERROR[Main]: ...etest/games/mineclone2/mods/PLAYER/mcl_hunger/hunger.lua:160: in function 'eat' 2021-01-04 13:52:55: ERROR[Main]: ...etest/games/mineclone2/mods/PLAYER/mcl_hunger/hunger.lua:44: in function <...etest/games/mineclone2/mods/PLAYER/mcl_hunger/hunger.lua:6> ```
Contributor

get_velocity() doesn't work in 5.3.
it should but...
i have a wrap for that but not sure whether it good or not: local velocity = player:get_velocity() or player:get_player_velocity() or {x=0,y=-10,z=0}

```get_velocity()``` doesn't work in 5.3. it should but... i have a wrap for that but not sure whether it good or not: [```local velocity = player:get_velocity() or player:get_player_velocity() or {x=0,y=-10,z=0}```](https://git.minetest.land/Wuzzy/MineClone2/issues/850)
Contributor

trying to fix locally

00146c96e5

trying to fix locally https://git.minetest.land/kay27/MineClone2/commit/00146c96e5fa8eba5c1989a611b4eef45cf4f178
Contributor

yep, the fix works as expected

yep, the fix works as expected
LizzyFleckenstein03 referenced this issue from a commit 2021-01-05 11:46:10 +01:00
Author
Member

Ok, I did not expect minetest to be that broken. Do you currently have access rights to this repo or do I need to merge it for you? If so, I need to know how I can pick up a single commit.

Ok, I did not expect minetest to be that broken. Do you currently have access rights to this repo or do I need to merge it for you? If so, I need to know how I can pick up a single commit.
Author
Member

Ok, git cherry-pick did the job.

Ok, `git cherry-pick` did the job.
Contributor

Thanks. Wussy had revoked the rights, so you are the only one who can help him to fix critical bugs in master.

I don't know whether 5.3 broken or it must be so (?), minetest issue tracker keeps silence about that too...

Thanks. Wussy had revoked the rights, so you are the only one who can help him to fix critical bugs in master. I don't know whether 5.3 broken or it must be so (?), minetest issue tracker keeps silence about that too...
Author
Member

I know what happened. You asked about MT 5.4 compability in the other issue, so I tried it out in MT 5.4 and noticed the warnings. In 5.3 there is get_player_velocity and get_velocity returns nil for players, and in 5.4 get_velocity and get_player_velocity both return the velocity, but get_player_velocity is deprecated.

I know what happened. You asked about MT 5.4 compability in the other issue, so I tried it out in MT 5.4 and noticed the warnings. In 5.3 there is get_player_velocity and get_velocity returns nil for players, and in 5.4 get_velocity and get_player_velocity both return the velocity, but get_player_velocity is deprecated.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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: VoxeLibre/VoxeLibre#954
No description provided.