testserver itemframes/init.lua:199: attempt to index local 'e' (a nil value) #6535

Open
opened 2024-03-20 08:38:52 +00:00 by AliasAlreadyTaken · 8 comments

Rather rare case, but this happens when there are 52 000 itemframes around:

2024-03-20 08:37:08: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'itemframes' in callback LuaLBM::trigger(): ...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:199: attempt to index local 'e' (a nil value)
2024-03-20 08:37:08: ERROR[Main]: stack traceback:
2024-03-20 08:37:08: ERROR[Main]: 	...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:199: in function 'update_item'
2024-03-20 08:37:08: ERROR[Main]: 	...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:681: in function 'func'
2024-03-20 08:37:08: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:108: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:101>
Rather rare case, but this happens when there are 52 000 itemframes around: ``` 2024-03-20 08:37:08: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'itemframes' in callback LuaLBM::trigger(): ...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:199: attempt to index local 'e' (a nil value) 2024-03-20 08:37:08: ERROR[Main]: stack traceback: 2024-03-20 08:37:08: ERROR[Main]: ...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:199: in function 'update_item' 2024-03-20 08:37:08: ERROR[Main]: ...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:681: in function 'func' 2024-03-20 08:37:08: ERROR[Main]: ...inetest_test/bin/../builtin/profiler/instrumentation.lua:108: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:101> ```
AliasAlreadyTaken added the
1. kind/bug
3. source/mod upstream
labels 2024-03-20 08:38:58 +00:00
Member

Server gave up creating entities:

	local e = minetest.add_entity(pos, "itemframes:item")

	if ntype == "frame" then

		e:set_rotation({x = pitch, y = yaw, z = roll})
	end
Server gave up creating entities: ```lua local e = minetest.add_entity(pos, "itemframes:item") if ntype == "frame" then e:set_rotation({x = pitch, y = yaw, z = roll}) end ```
Author
Owner
2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects.
2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects.
2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects.
2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects.
2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects.
2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects.
2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects.
2024-03-20 08:53:03: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'itemframes' in callback LuaLBM::trigger(): ...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:199: attempt to index local 'e' (a nil value)
2024-03-20 08:53:03: ERROR[Main]: stack traceback:
2024-03-20 08:53:03: ERROR[Main]: 	...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:199: in function 'update_item'
2024-03-20 08:53:03: ERROR[Main]: 	...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:681: in function 'func'
2024-03-20 08:53:03: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:108: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:101>
``` 2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects. 2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects. 2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects. 2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects. 2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects. 2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects. 2024-03-20 08:53:02: WARNING[Main]: MapBlock::saveStaticObject(): Trying to store id = 0 statically but block (128,1,72) already contains 2400 objects. 2024-03-20 08:53:03: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'itemframes' in callback LuaLBM::trigger(): ...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:199: attempt to index local 'e' (a nil value) 2024-03-20 08:53:03: ERROR[Main]: stack traceback: 2024-03-20 08:53:03: ERROR[Main]: ...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:199: in function 'update_item' 2024-03-20 08:53:03: ERROR[Main]: ...e/mt/5.8.0/Minetest_test/bin/../mods/itemframes/init.lua:681: in function 'func' 2024-03-20 08:53:03: ERROR[Main]: ...inetest_test/bin/../builtin/profiler/instrumentation.lua:108: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:101> ```
Member

Wait, if there's a limit of 2400 per mapblock, does that mean that you can't have a full mapblock of item frames?
(well, you can, but entities won't be saved...)

It does not matter in practice, but it's interesting, I guess...

Wait, if there's a limit of 2400 per mapblock, does that mean that you can't have a full mapblock of item frames? (well, you can, but entities won't be saved...) It does not matter in practice, but it's interesting, I guess...
Author
Owner

Where does this limit come from?

Where does this limit come from?
Member
	settings->setDefault("max_objects_per_block", "256");

it's a setting, and you already increased it 10x :D

```c++ settings->setDefault("max_objects_per_block", "256"); ``` it's a setting, and you already increased it 10x :D
Author
Owner
	settings->setDefault("max_objects_per_block", "256");

it's a setting, and you already increased it 10x :D

Odd, this setting is on

max_objects_per_block = 512

> ```c++ > settings->setDefault("max_objects_per_block", "256"); > ``` > it's a setting, and you already increased it 10x :D Odd, this setting is on max_objects_per_block = 512
Member

this happens when there are 52 000 itemframes around

if there's a limit of 2400 per mapblock, does that mean that you can't have a full mapblock of item frames?

max_objects_per_block = 512

that's just the limit of what can be statically saved (persisted, in memory or on disk) in that mapblock - it doesn't limit the number of entities that can be spawned there directly. there's a 65535 global limit, though, that might be relevant with such large numbers of entities.

> this happens when there are 52 000 itemframes around > if there's a limit of 2400 per mapblock, does that mean that you can't have a full mapblock of item frames? > max_objects_per_block = 512 that's just the limit of what can be statically saved (persisted, in memory or on disk) in that mapblock - it doesn't limit the number of entities that can be spawned there directly. there's a 65535 global limit, though, that might be relevant with such large numbers of entities.
Member

another reason to limit the existence of node-bound entities to when a player is within about 8 nodes from them. as discussed elsewhere, this is tricky and not totally reliable. but worth trying.

another reason to limit the existence of node-bound entities to when a player is within about 8 nodes from them. as discussed elsewhere, this is tricky and not totally reliable. but worth trying.
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#6535
No description provided.