Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory gets overfilled after teleporting and setting the second mark #114

Closed
HybridDog opened this issue May 12, 2016 · 7 comments
Closed
Labels

Comments

@HybridDog
Copy link
Contributor

HybridDog commented May 12, 2016

l tried this more times:
At first execute /teleport 2000 0 0
then //pos1
after that /teleport 3000 1000 1000
and then //pos2

After executing the last chatcommand, minetest gets stuck in some infinite loop or something similar
and if l wait and do not quickly quit minetest, my memory gets filled more and more (no OOM crash happens) and then l need to reboot my pc because of memory problems

Now l got a bad alloc crash:

2016-05-12 20:11:10: ACTION[Server]: singleplayer joins game. List of players: singleplayer
2016-05-12 20:11:27: ERROR[Main]: ServerError: Lua: Runtime error from mod 'worldedit_shortcommands' in callback on_chat_message(): std::bad_alloc
2016-05-12 20:11:27: ERROR[Main]: stack traceback:
2016-05-12 20:11:27: ERROR[Main]:   [C]: in function 'read_from_map'
2016-05-12 20:11:27: ERROR[Main]:   ...minetest/mods/WorldEdit-pack/worldedit_commands/mark.lua:68: in function 'mark_region'
2016-05-12 20:11:27: ERROR[Main]:   ...minetest/mods/WorldEdit-pack/worldedit_commands/mark.lua:48: in function 'mark_pos2'
2016-05-12 20:11:27: ERROR[Main]:   ...minetest/mods/WorldEdit-pack/worldedit_commands/init.lua:189: in function 'func'
2016-05-12 20:11:27: ERROR[Main]:   /usr/share/minetest/builtin/game/chatcommands.lua:42: in function </usr/share/minetest/builtin/game/chatcommands.lua:30>
2016-05-12 20:11:27: ERROR[Main]:   /usr/share/minetest/builtin/game/register.lua:369: in function </usr/share/minetest/builtin/game/register.lua:349>
2016-05-12 20:11:27: ACTION[Server]: singleplayer leaves game. List of players: 

l took a look at worldedit_commands/mark.lua:
manip:read_from_map is executed for the entire area, the area is big (a billion nodes)
so minetest tries that and fills up all memory,
the bad alloc maybe happened because it tried to reserve/allocate more memory than l have

obviously wordledit can be used to crash the server pc by simply setting pos1 and pos2 far away from each other

l guess l need to forgo my attempt on setting one billion nodes at once using worldedit.
At least l know that ~2.5 million nodes take ~0.3 seconds (with my changes).

@ShadowNinja
Copy link
Collaborator

Bug because you shouldn't be able to OOM the server so easily, even if you have to be a moderator to do it.

@paramat
Copy link

paramat commented May 14, 2016

I feel the voxelmanip volume, and therefore memory use, should be limited in worldedit not in the voxelmanip. A limit setting that can be set according to server memory available.
The volume you were trying to set was far too big, voxelmanip is meant to process a few chunks at most.

@ShadowNinja
Copy link
Collaborator

Related: #97

@HybridDog
Copy link
Contributor Author

ps can be used to give information about memory:

       rss         RSS       resident set size, the non-swapped physical memory that a task has used (inkiloBytes).
       size        SIZE      approximate amount of swap space that would be required if the process were to dirty all writable pages and then be swapped
                             out.  This number is very rough!
       sz          SZ        size in physical pages of the core image of the process.  This includes text, data, and stack space.  Device mappings are
                             currently excluded; this is subject to change.  See vsz and rss.
       vsz         VSZ       virtual memory size of the process in KiB (1024-byte units).  Device mappings are currently excluded; this is subject to
                             change.  (alias vsize).

Which one would l need to choose?

@paramat
Copy link

paramat commented May 29, 2016

Why closed?

@HybridDog HybridDog reopened this May 29, 2016
@HybridDog
Copy link
Contributor Author

HybridDog commented May 29, 2016

l tried to measure the memory difference but l didn't have success, the value was to small, e.g. 278545 nodes, -4 KiB.
HybridDog@20f5f7c

@sfan5
Copy link
Collaborator

sfan5 commented Oct 12, 2016

duplicate of #97

@sfan5 sfan5 closed this as completed Oct 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants