crash using grep_nodes #2044

Closed
opened 2022-06-07 17:01:45 +00:00 by flux · 6 comments
Member

Originally posted by @AliasAlreadyTaken in #2006 (comment)

Nice!

Maybe we need a max limit ... :

/area2we 2
//grep_nodes 1000 cobble

leads to

2022-06-07 12:35:39: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'yl_commons' in callback on_chat_message(): table overflow
2022-06-07 12:35:39: ERROR[Main]: stack traceback:
2022-06-07 12:35:39: ERROR[Main]: 	[C]: in function 'get_data'
2022-06-07 12:35:39: ERROR[Main]: 	..._test/bin/../mods/yl_commons/chatcommands/grep_nodes.lua:47: in function 'func'
2022-06-07 12:35:39: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function 'func'
2022-06-07 12:35:39: ERROR[Main]: 	.../mtlive/5.5.1/Minetest_test/bin/../builtin/game/chat.lua:79: in function 'func'
2022-06-07 12:35:39: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2022-06-07 12:35:39: ERROR[Main]: 	...ive/5.5.1/Minetest_test/bin/../builtin/game/register.lua:429: in function <...ive/5.5.1/Minetest_test/bin/../builtin/game/register.lua:415>
_Originally posted by @AliasAlreadyTaken in https://gitea.your-land.de/your-land/bugtracker/issues/2006#issuecomment-19116_ Nice! Maybe we need a max limit ... : ``` /area2we 2 //grep_nodes 1000 cobble ``` leads to ``` 2022-06-07 12:35:39: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'yl_commons' in callback on_chat_message(): table overflow 2022-06-07 12:35:39: ERROR[Main]: stack traceback: 2022-06-07 12:35:39: ERROR[Main]: [C]: in function 'get_data' 2022-06-07 12:35:39: ERROR[Main]: ..._test/bin/../mods/yl_commons/chatcommands/grep_nodes.lua:47: in function 'func' 2022-06-07 12:35:39: ERROR[Main]: ...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function 'func' 2022-06-07 12:35:39: ERROR[Main]: .../mtlive/5.5.1/Minetest_test/bin/../builtin/game/chat.lua:79: in function 'func' 2022-06-07 12:35:39: ERROR[Main]: ...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100> 2022-06-07 12:35:39: ERROR[Main]: ...ive/5.5.1/Minetest_test/bin/../builtin/game/register.lua:429: in function <...ive/5.5.1/Minetest_test/bin/../builtin/game/register.lua:415> ```
Author
Member

actually, the line where the crash happens is

local data = vm:get_data()

which suggests that it's not the value of 1000, but the size of the selected region, that's causing the problem... did you try running it on haven?

solution would be to either

  1. limit the volume you can run the command on
  2. break up the selected volume into sub-regions and grep through each of those. if done right, this would also make the command less likely to cause a huge lag spike
actually, the line where the crash happens is ```lua local data = vm:get_data() ``` which suggests that it's not the value of 1000, but the size of the selected region, that's causing the problem... did you try running it on haven? solution would be to either 1. limit the volume you can run the command on 2. break up the selected volume into sub-regions and grep through each of those. if done right, this would also make the command less likely to cause a huge lag spike
flux added the
1. kind/bug
4. step/question
2. prio/critical
labels 2022-06-07 17:04:56 +00:00
Author
Member

fixed in 42ee69257e by breaking the job up into multiple small jobs

fixed in https://gitea.your-land.de/your-land/yl_commons/commit/42ee69257ecca3769f3463884ee60e7ec147ec9c by breaking the job up into multiple small jobs
flux added
4. step/ready to QA test
and removed
4. step/question
labels 2022-06-07 19:55:22 +00:00
AliasAlreadyTaken added this to the 1.1.113 milestone 2022-06-08 11:41:26 +00:00

Yes, aera with id2 is Haven ...

Yes, aera with id2 is Haven ...
Author
Member

in my original tests, i ran it on an area that was 1000x1000 in the x/z dimensions, though only may 80 nodes tall. i didn't take into account that haven was, in truth, mostly air =D

in my original tests, i ran it on an area that was 1000x1000 in the x/z dimensions, though only may 80 nodes tall. i didn't take into account that haven was, in truth, mostly air =D
Author
Member

i like the current solution, but i feel like adding a HUD element that shows how much has been completed would be helpful... as well as a way to abort it.

but i think such a solution should be worked into WE in general. and an undo mechanism.

i like the current solution, but i feel like adding a HUD element that shows how much has been completed would be helpful... as well as a way to abort it. but i think such a solution should be worked into WE in general. and an undo mechanism.
Author
Member

should be live

should be live
flux closed this issue 2022-06-22 15:55:06 +00:00
flux added
5. result/fixed
and removed
4. step/ready to QA test
labels 2022-06-22 15:55:16 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#2044
No description provided.