unified_inventory/bags.lua:58: attempt to perform arithmetic on local 'slots' (a nil value) #3382

Closed
opened 2022-12-31 13:35:58 +00:00 by AliasAlreadyTaken · 10 comments

2022-12-31 13:32:05: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'unified_inventory' in callback on_playerReceiveFields(): ...6.1/Minetest_live/bin/../mods/unified_inventory/bags.lua:58: attempt to perform arithmetic on local 'slots' (a nil value)
2022-12-31 13:32:05: ERROR[Main]: stack traceback:
2022-12-31 13:32:05: ERROR[Main]: ...6.1/Minetest_live/bin/../mods/unified_inventory/bags.lua:58: in function 'get_formspec'
2022-12-31 13:32:05: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:306: in function 'get_formspec'
2022-12-31 13:32:05: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:331: in function 'set_inventory_formspec'
2022-12-31 13:32:05: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:415: in function 'apply_filter'
2022-12-31 13:32:05: ERROR[Main]: ...inetest_live/bin/../mods/unified_inventory/callbacks.lua:207: in function 'func'
2022-12-31 13:32:05: ERROR[Main]: ...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:100>
2022-12-31 13:32:05: ERROR[Main]: .../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:431: in function <.../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:417>

2022-12-31 13:32:05: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'unified_inventory' in callback on_playerReceiveFields(): ...6.1/Minetest_live/bin/../mods/unified_inventory/bags.lua:58: attempt to perform arithmetic on local 'slots' (a nil value) 2022-12-31 13:32:05: ERROR[Main]: stack traceback: 2022-12-31 13:32:05: ERROR[Main]: ...6.1/Minetest_live/bin/../mods/unified_inventory/bags.lua:58: in function 'get_formspec' 2022-12-31 13:32:05: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:306: in function 'get_formspec' 2022-12-31 13:32:05: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:331: in function 'set_inventory_formspec' 2022-12-31 13:32:05: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:415: in function 'apply_filter' 2022-12-31 13:32:05: ERROR[Main]: ...inetest_live/bin/../mods/unified_inventory/callbacks.lua:207: in function 'func' 2022-12-31 13:32:05: ERROR[Main]: ...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:100> 2022-12-31 13:32:05: ERROR[Main]: .../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:431: in function <.../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:417>
flux added the
1. kind/bug
2. prio/critical
labels 2022-12-31 18:37:14 +00:00
Member

this looks like someone somehow got something that isn't a bag into their bag slots?!

this looks like someone somehow got something that isn't a bag into their bag slots?!
Member

or possibly, tried to open up the inventory screen for a bag slot that was empty...

or possibly, tried to open up the inventory screen for a bag slot that was empty...
Author
Owner

2023-02-18 19:11:35: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'unified_inventory' in callback on_playerReceiveFields(): ...6.1/Minetest_live/bin/../mods/unified_inventory/bags.lua:67: attempt to perform arithmetic on local 'slots' (a nil value)
2023-02-18 19:11:35: ERROR[Main]: stack traceback:
2023-02-18 19:11:35: ERROR[Main]: ...6.1/Minetest_live/bin/../mods/unified_inventory/bags.lua:67: in function 'get_formspec'
2023-02-18 19:11:35: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:309: in function 'get_formspec'
2023-02-18 19:11:35: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:334: in function 'set_inventory_formspec'
2023-02-18 19:11:35: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:418: in function 'apply_filter'
2023-02-18 19:11:35: ERROR[Main]: ...inetest_live/bin/../mods/unified_inventory/callbacks.lua:207: in function 'func'
2023-02-18 19:11:35: ERROR[Main]: ...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:100>
2023-02-18 19:11:35: ERROR[Main]: .../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:431: in function <.../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:417>

2023-02-18 19:11:35: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'unified_inventory' in callback on_playerReceiveFields(): ...6.1/Minetest_live/bin/../mods/unified_inventory/bags.lua:67: attempt to perform arithmetic on local 'slots' (a nil value) 2023-02-18 19:11:35: ERROR[Main]: stack traceback: 2023-02-18 19:11:35: ERROR[Main]: ...6.1/Minetest_live/bin/../mods/unified_inventory/bags.lua:67: in function 'get_formspec' 2023-02-18 19:11:35: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:309: in function 'get_formspec' 2023-02-18 19:11:35: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:334: in function 'set_inventory_formspec' 2023-02-18 19:11:35: ERROR[Main]: ...Minetest_live/bin/../mods/unified_inventory/internal.lua:418: in function 'apply_filter' 2023-02-18 19:11:35: ERROR[Main]: ...inetest_live/bin/../mods/unified_inventory/callbacks.lua:207: in function 'func' 2023-02-18 19:11:35: ERROR[Main]: ...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:100> 2023-02-18 19:11:35: ERROR[Main]: .../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:431: in function <.../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:417>
Author
Owner

I added before local formspec = { this logging:

if not slots then
		core.log("error","#3382: stack = "..dump(stack))
		core.log("error","#3382: playername = "..dump(player:get_player_name()))
		core.log("error","#3382: perplayer_formspec = "..dump(perplayer_formspec))
		core.log("error","#3382: bag_i = "..dump(bag_i))
end
I added before `local formspec = {` this logging: ``` if not slots then core.log("error","#3382: stack = "..dump(stack)) core.log("error","#3382: playername = "..dump(player:get_player_name())) core.log("error","#3382: perplayer_formspec = "..dump(perplayer_formspec)) core.log("error","#3382: bag_i = "..dump(bag_i)) end ```
Member

You get a crash if you:

  1. empty everything from your bag (so you can take it out of the slot).
  2. take bag out of slot and not putting it anywhere click the button that opens that bag. Now you have your bag open while still holding it with your mouse.
  3. click on the search field with the bag.
  4. kaboom
    :P
You get a crash if you: 1. empty everything from your bag (so you can take it out of the slot). 2. take bag out of slot and not putting it anywhere click the button that opens that bag. Now you have your bag open while still holding it with your mouse. 3. click on the search field with the bag. 4. *kaboom* :P
Author
Owner

2023-06-17 16:53:29: ACTION[Server]: [yl_commons] whosit takes "unified_inventory:bag_large" from {"name":"whosit","type":"player"} [main]
2023-06-17 16:53:30: ACTION[Server]: [yl_commons] formspec "": whosit submitted {"bag1":"Bag 1","searchbox":"somw"}
2023-06-17 16:53:35: ACTION[Server]: [yl_commons] formspec "": whosit submitted {"bags":"","searchbox":"somw"}
2023-06-17 16:53:37: ACTION[Server]: [yl_commons] lua is using 250.6 MB
2023-06-17 16:53:38: ACTION[Server]: [yl_commons] formspec "": whosit submitted {"bag1":"Bag 1","searchbox":"somw"}
2023-06-17 16:53:41: ACTION[Server]: [yl_commons] whosit moves "unified_inventory:bag_large" to {"name":"whosit","type":"player"} [main]
2023-06-17 16:53:43: ACTION[Server]: [yl_commons] formspec "": whosit submitted {"key_enter":"true","key_enter_field":"searchbox","searchbox":"som"}
2023-06-17 16:53:43: ACTION[Main]: Server: Shutting down
2023-06-17 16:53:43: ACTION[Server]: [MOD] smart_chat : Module core: *** leaves the World.
2023-06-17 16:53:43: ACTION[Server]: whosit leaves game. List of players:
2023-06-17 16:53:47: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'unified_inventory' in callback on_playerReceiveFields(): ...7.0/Minetest_test/bin/../mods/unified_inventory/bags.lua:67: attempt to perform arithmetic on local 'slots' (a nil value)
2023-06-17 16:53:47: ERROR[Main]: stack traceback:
2023-06-17 16:53:47: ERROR[Main]: ...7.0/Minetest_test/bin/../mods/unified_inventory/bags.lua:67: in function 'get_formspec'
2023-06-17 16:53:47: ERROR[Main]: ...Minetest_test/bin/../mods/unified_inventory/internal.lua:309: in function 'get_formspec'
2023-06-17 16:53:47: ERROR[Main]: ...Minetest_test/bin/../mods/unified_inventory/internal.lua:334: in function 'set_inventory_formspec'
2023-06-17 16:53:47: ERROR[Main]: ...Minetest_test/bin/../mods/unified_inventory/internal.lua:418: in function 'apply_filter'
2023-06-17 16:53:47: ERROR[Main]: ...inetest_test/bin/../mods/unified_inventory/callbacks.lua:79: in function 'receive_fields_searchbox'
2023-06-17 16:53:47: ERROR[Main]: ...inetest_test/bin/../mods/unified_inventory/callbacks.lua:96: in function 'func'
2023-06-17 16:53:47: ERROR[Main]: ...inetest_test/bin/../builtin/profiler/instrumentation.lua:108: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:101>
2023-06-17 16:53:47: ERROR[Main]: .../mt/5.7.0/Minetest_test/bin/../builtin/game/register.lua:446: in function <.../mt/5.7.0/Minetest_test/bin/../builtin/game/register.lua:432>

2023-06-17 16:53:29: ACTION[Server]: [yl_commons] whosit takes "unified_inventory:bag_large" from {"name":"whosit","type":"player"} [main] 2023-06-17 16:53:30: ACTION[Server]: [yl_commons] formspec "": whosit submitted {"bag1":"Bag 1","searchbox":"somw"} 2023-06-17 16:53:35: ACTION[Server]: [yl_commons] formspec "": whosit submitted {"bags":"","searchbox":"somw"} 2023-06-17 16:53:37: ACTION[Server]: [yl_commons] lua is using 250.6 MB 2023-06-17 16:53:38: ACTION[Server]: [yl_commons] formspec "": whosit submitted {"bag1":"Bag 1","searchbox":"somw"} 2023-06-17 16:53:41: ACTION[Server]: [yl_commons] whosit moves "unified_inventory:bag_large" to {"name":"whosit","type":"player"} [main] 2023-06-17 16:53:43: ACTION[Server]: [yl_commons] formspec "": whosit submitted {"key_enter":"true","key_enter_field":"searchbox","searchbox":"som"} 2023-06-17 16:53:43: ACTION[Main]: Server: Shutting down 2023-06-17 16:53:43: ACTION[Server]: [MOD] smart_chat : Module core: *** leaves the World. 2023-06-17 16:53:43: ACTION[Server]: whosit leaves game. List of players: 2023-06-17 16:53:47: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'unified_inventory' in callback on_playerReceiveFields(): ...7.0/Minetest_test/bin/../mods/unified_inventory/bags.lua:67: attempt to perform arithmetic on local 'slots' (a nil value) 2023-06-17 16:53:47: ERROR[Main]: stack traceback: 2023-06-17 16:53:47: ERROR[Main]: ...7.0/Minetest_test/bin/../mods/unified_inventory/bags.lua:67: in function 'get_formspec' 2023-06-17 16:53:47: ERROR[Main]: ...Minetest_test/bin/../mods/unified_inventory/internal.lua:309: in function 'get_formspec' 2023-06-17 16:53:47: ERROR[Main]: ...Minetest_test/bin/../mods/unified_inventory/internal.lua:334: in function 'set_inventory_formspec' 2023-06-17 16:53:47: ERROR[Main]: ...Minetest_test/bin/../mods/unified_inventory/internal.lua:418: in function 'apply_filter' 2023-06-17 16:53:47: ERROR[Main]: ...inetest_test/bin/../mods/unified_inventory/callbacks.lua:79: in function 'receive_fields_searchbox' 2023-06-17 16:53:47: ERROR[Main]: ...inetest_test/bin/../mods/unified_inventory/callbacks.lua:96: in function 'func' 2023-06-17 16:53:47: ERROR[Main]: ...inetest_test/bin/../builtin/profiler/instrumentation.lua:108: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:101> 2023-06-17 16:53:47: ERROR[Main]: .../mt/5.7.0/Minetest_test/bin/../builtin/game/register.lua:446: in function <.../mt/5.7.0/Minetest_test/bin/../builtin/game/register.lua:432>
Member

You get a crash if you:

i needed to do a couple extra things to trigger the crash:

  1. empty everything from your bag (so you can take it out of the slot).
  2. take bag out of slot and not putting it anywhere click the button that opens that bag. Now you have your bag open while still holding it with your mouse.

then, put the bag in your main inventory.

  1. click on the search field with the bag.

then, enter some text and click send or hit enter

  1. kaboom
    :P
> You get a crash if you: i needed to do a couple extra things to trigger the crash: > 1. empty everything from your bag (so you can take it out of the slot). > 2. take bag out of slot and not putting it anywhere click the button that opens that bag. Now you have your bag open while still holding it with your mouse. then, put the bag in your main inventory. > 3. click on the search field with the bag. then, enter some text and click send or hit enter > 4. *kaboom* > :P
Member
upstream issue: https://github.com/minetest-mods/unified_inventory/issues/232
flux added the
3. source/mod upstream
label 2023-06-18 15:24:44 +00:00
flux added the
4. step/ready to QA test
label 2023-06-20 18:40:26 +00:00
Member

upstream is fixed

upstream is fixed
AliasAlreadyTaken added this to the 1.1.120 milestone 2023-06-21 19:04:11 +00:00
AliasAlreadyTaken added the
ugh/QA OK
label 2023-08-28 10:47:13 +00:00
flux added
5. result/fixed
and removed
4. step/ready to QA test
labels 2023-11-16 21:28:03 +00:00
Member

this is live

this is live
flux closed this issue 2023-11-16 21:28:13 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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: your-land/bugtracker#3382
No description provided.