server crash when def.wield_scale is not a number value #3971

Closed
opened 2023-10-20 16:18:38 +02:00 by pepebotella · 10 comments
Contributor

MineClone2 version:

master branch commit 3d7155c1b9

What happened?

A server crash

ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '??' in callback item_OnDrop(): "Runtime error from mod '??' in callback l_add_item(): .../games/MineClone2/mods/ENTITIES/mcl_item_entity/init.lua:678: attempt to index field 'wield_scale' (a number value)
ERROR[Main]: stack traceback:
ERROR[Main]: 	.../games/MineClone2/mods/ENTITIES/mcl_item_entity/init.lua:678: in function 'set_item'
ERROR[Main]: 	...minetest/bin/../builtin/game/item_entity.lua:9: in function <...minetest/bin/../builtin/game/item_entity.lua:3>
ERROR[Main]: 	[C]: in function 'add_item'
ERROR[Main]: 	...mods/ENTITIES/mcl_item_entity/init.lua:375: in function <.../games/MineClone2/mods/ENTITIES/mcl_item_entity/init.lua:366>"
ERROR[Main]: stack traceback:
ERROR[Main]: 	[C]: in function 'add_item'
ERROR[Main]: 	.../games/MineClone2/mods/ENTITIES/mcl_item_entity/init.lua:375: in function <.../games/MineClone2/mods/ENTITIES/mcl_item_entity/init.lua:366>

Steps to reproduce

Bug related with:

MineClone2/MineClone2#3961

MineClone2/MineClone2#3914

MineClone2/MineClone2#3913

MineClone2/MineClone2#3915

crash when def.wield_scale is not a number value

MineClone2 version: master branch commit 3d7155c1b9029fceb58807d392b2d80a8e4b0d9b ### What happened? A server crash ``` ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '??' in callback item_OnDrop(): "Runtime error from mod '??' in callback l_add_item(): .../games/MineClone2/mods/ENTITIES/mcl_item_entity/init.lua:678: attempt to index field 'wield_scale' (a number value) ERROR[Main]: stack traceback: ERROR[Main]: .../games/MineClone2/mods/ENTITIES/mcl_item_entity/init.lua:678: in function 'set_item' ERROR[Main]: ...minetest/bin/../builtin/game/item_entity.lua:9: in function <...minetest/bin/../builtin/game/item_entity.lua:3> ERROR[Main]: [C]: in function 'add_item' ERROR[Main]: ...mods/ENTITIES/mcl_item_entity/init.lua:375: in function <.../games/MineClone2/mods/ENTITIES/mcl_item_entity/init.lua:366>" ERROR[Main]: stack traceback: ERROR[Main]: [C]: in function 'add_item' ERROR[Main]: .../games/MineClone2/mods/ENTITIES/mcl_item_entity/init.lua:375: in function <.../games/MineClone2/mods/ENTITIES/mcl_item_entity/init.lua:366> ``` ### Steps to reproduce Bug related with: https://git.minetest.land/MineClone2/MineClone2/issues/3961 https://git.minetest.land/MineClone2/MineClone2/pulls/3914 https://git.minetest.land/MineClone2/MineClone2/issues/3913 https://git.minetest.land/MineClone2/MineClone2/issues/3915 crash when `def.wield_scale` is not a number value
pepebotella added the
bug
unconfirmed
labels 2023-10-20 16:18:38 +02:00
pepebotella changed title from server crash attempt to index field 'wield_scale' (a number value) to server crash when def.wield_scale is nil 2023-10-20 16:24:34 +02:00
pepebotella changed title from server crash when def.wield_scale is nil to server crash when def.wield_scale is not a number value 2023-10-20 16:28:48 +02:00

What item are you trying to wield here? def.wield_scale should be a vector and is across the code base. Somehow it looks like your wield scale on the definition is a number, not a vector, and I cannot see an example in the code that looks like this is the case for.

Without further information for this, it would be very hard to investigate further.

What item are you trying to wield here? def.wield_scale should be a vector and is across the code base. Somehow it looks like your wield scale on the definition is a number, not a vector, and I cannot see an example in the code that looks like this is the case for. Without further information for this, it would be very hard to investigate further.
Member

Wield_scale, per the definition in the Minetest API is a Vector3.
Trying to force it to a single number will cause everything to break, not just mineclone. The reason that it's a vector 3 and not a single float, is that when it is wielded, it's a 3D object.

Item Definition

So, I am left wondering why it is that you want it to be a single float number?

Wield_scale, per the definition in the Minetest API is a Vector3. Trying to force it to a single number will cause everything to break, not just mineclone. The reason that it's a vector 3 and not a single float, is that when it is wielded, it's a 3D object. > [Item Definition](https://minetest.gitlab.io/minetest/definition-tables/#item-definition) So, I am left wondering why it is that you want it to be a single float number?

We can fix it updating show_wielded_item from upstream

fixed in MineClonia by @cora

https://codeberg.org/mineclonia/mineclonia/pulls/618

That one has nothing to do with what you are reporting. Unless you show me how that is relevant, continuing to "contribute" useless comments and incorrect code will be seen as spam.

> We can fix it updating show_wielded_item from upstream > > fixed in [MineClonia](https://codeberg.org/mineclonia/mineclonia) by @cora > > https://codeberg.org/mineclonia/mineclonia/pulls/618 That one has nothing to do with what you are reporting. Unless you show me how that is relevant, continuing to "contribute" useless comments and incorrect code will be seen as spam.
Author
Contributor

I only report real crashes that happen to me

I'm trying to help

If my PR is werong just close it

I only report real crashes that happen to me I'm trying to help If my PR is werong just close it
Member

I only report real crashes that happen to me

I'm trying to help

If my PR is wrong just close it

I understand, and I genuinely appreciate you reporting them. But, it should be a vector3. I think the real issue here is that the error message was misleading.

> I only report real crashes that happen to me > > I'm trying to help > > If my PR is wrong just close it I understand, and I genuinely appreciate you reporting them. But, it should be a vector3. I think the real issue here is that the error message was misleading.

That issue should be closed or not? Should we also close issues #4048, #3976 and #3973 (issues related to fake players)?

That issue should be closed or not? Should we also close issues #4048, #3976 and #3973 (issues related to fake players)?

That issue should be closed or not?

Why would it be?

> That issue should be closed or not? Why would it be?

Why would it be?

def.wield_scale should be a vector

> Why would it be? >>def.wield_scale should be a vector
ancientmarinerdev added the
possible close
label 2024-05-30 16:39:59 +02:00

As we didn't get an answer on what item had an issue with wield_scale, I'm assuming it's a custom item and a data issue. Without further information, it's impossible to really proceed with this one. We should close it until more information surfaces.

As we didn't get an answer on what item had an issue with wield_scale, I'm assuming it's a custom item and a data issue. Without further information, it's impossible to really proceed with this one. We should close it until more information surfaces.

Closing. wield_scale must be a vector and not a single number under MTE 5.6.1 Lua API, so for whatever we support, a single number there is invalid.

Closing. `wield_scale` must be a vector and not a single number under MTE 5.6.1 Lua API, so for whatever we support, a single number there is invalid.
the-real-herowl added the
invalid / won't fix
label 2024-05-30 17:13:12 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 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#3971
No description provided.