Daïmanu wrote:Hi.
Recently, the server started to say frequently errors like:
ERROR[ServerThread]: ServerEnv: Trying to store id=498 statically but block (-20,0,-19) already contains 49 objects. Forcing delete.
or
ERROR[ServerThread]: suspiciously large amount of objects detected: 50 in (-20,0,-19); removing all of them.
I can consistently make these error messages appear with moretrees (default settings) and its dependancy lib plantlife_modpack:plants_lib as the only mods, and minetest from the git repository:
Create a new singleplayer world with these mods.
Teleport far away of the spawning area, like to 1500,_,1500.
Find a moretree tree and cut it down. Acacias and palm trees are the easiest.
Wait a minute for enough leaves to fall down as items.
Zone out.
Zone back in.
For trees with hundreds of leaves, you get the error messages (the two of them in 'debug.txt' and one of them on the screen) each time you zone out and back in. It's only a couple of times with an acacia.
The two error message "ERROR[ServerThread]: ServerEnv: Trying to store id..." and "ERROR[ServerThread]: suspiciously large amount of objects detected..." always tell about coordinates roughly in the range (-100 <= x <= 100, y = 0, -100 <= z <= 100). It's the spawning area from what I guess.
They look wrong compared to where you really are.
Sol wrote:
You can try add logging for objects in l_env.cpp:
add this line:
[...]
I did that. motretrees uses the function minetest.add_item(), which calls the lua function core.spawn_item(), which calls the c++ function l_add_entity() you quoted with "__builtin:item" as entity name, from what I quickly read in the code. The coordinates it reports in the log messages are the ones where the leaves really are though. Only the error messages from the server have them wrong.
I don't see it as a bug, that a moretree tree that you cut down creates a suspicious number of items. But there must be a bug somewhere because the server reports that in a place that seems so wrong.
Edit:
Or maybe the "block" coordinates displayed in the error messages are different from the player and entities positions ? Block coordinates are (x, y, z) integers while (x, y, z) positions are real numbers. The error messages may be right but look wrong because we think they tell about an (x, y, z) position like the player position while they tell about an (x, y, z) "block" position in the loaded area.