sbrl / Minetest-WorldEditAdditions

Extra tools and commands to extend WorldEdit for Minetest
https://worldeditadditions.mooncarrot.space/
Mozilla Public License 2.0
16 stars 3 forks source link

Position system crash #88

Closed fluxionary closed 1 year ago

fluxionary commented 1 year ago

i think this was due to removing the worldedit additions entities (//clearobjects) and then trying to run another command.

2022-11-23 12:34:23: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'worldeditadditions_commands' in callback on_chat_message(): ...ons/worldeditadditions_core/core/entities/pos_marker.lua:58: attempt to index a nil value
2022-11-23 12:34:23: ERROR[Main]: stack traceback:
2022-11-23 12:34:23: ERROR[Main]:   ...ons/worldeditadditions_core/core/entities/pos_marker.lua:58: in function 'delete'
2022-11-23 12:34:23: ERROR[Main]:   ...tions/worldeditadditions_core/core/pos_marker_manage.lua:64: in function 'next_func'
2022-11-23 12:34:23: ERROR[Main]:   ...Additions/worldeditadditions_core/utils/EventEmitter.lua:65: in function 'emit'
2022-11-23 12:34:23: ERROR[Main]:   ...-WorldEditAdditions/worldeditadditions_core/core/pos.lua:37: in function 'compat_worldedit_pos1_get'
2022-11-23 12:34:23: ERROR[Main]:   ...-WorldEditAdditions/worldeditadditions_core/core/pos.lua:137: in function 'count'
2022-11-23 12:34:23: ERROR[Main]:   ...itAdditions/worldeditadditions_core/core/run_command.lua:25: in function 'run_command'
2022-11-23 12:34:23: ERROR[Main]:   ...itions/worldeditadditions_core/core/register_command.lua:57: in function 'func'
2022-11-23 12:34:23: ERROR[Main]:   /opt/minetest/bin/../builtin/profiler/instrumentation.lua:107: in function 'func'
2022-11-23 12:34:23: ERROR[Main]:   /opt/minetest/bin/../builtin/profiler/instrumentation.lua:107: in function 'func'
2022-11-23 12:34:23: ERROR[Main]:   /opt/minetest/bin/../builtin/game/chat.lua:79: in function 'func'
2022-11-23 12:34:23: ERROR[Main]:   /opt/minetest/bin/../builtin/profiler/instrumentation.lua:107: in function </opt/minetest/bin/../builtin/profiler/instrumentation.lua:100>
2022-11-23 12:34:23: ERROR[Main]:   /opt/minetest/bin/../builtin/game/register.lua:433: in function </opt/minetest/bin/../builtin/game/register.lua:419>
VorTechnix commented 1 year ago

I got same error when trying to use //set in a //multi command (I'm running Minetest 5.4.1 for compatibility reasons so some parts of the error have different numbers)

2023-01-10 08:35:05: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'worldeditadditions_commands' in callback on_chat_message(): ...ons\worldeditadditions_core/core/entities/pos_marker.lua:58: attempt to index a nil value
2023-01-10 08:35:05: ERROR[Main]: stack traceback:
2023-01-10 08:35:05: ERROR[Main]:   ...ons\worldeditadditions_core/core/entities/pos_marker.lua:58: in function 'delete'
2023-01-10 08:35:05: ERROR[Main]:   ...tions\worldeditadditions_core/core/pos_marker_manage.lua:64: in function 'next_func'
2023-01-10 08:35:05: ERROR[Main]:   ...Additions\worldeditadditions_core/utils/EventEmitter.lua:65: in function 'emit'
2023-01-10 08:35:05: ERROR[Main]:   ...\WorldEditAdditions\worldeditadditions_core/core/pos.lua:37: in function 'compat_worldedit_pos1_get'
2023-01-10 08:35:05: ERROR[Main]:   ...\WorldEditAdditions\worldeditadditions_core/core/pos.lua:137: in function 'count'
2023-01-10 08:35:05: ERROR[Main]:   ...itAdditions\worldeditadditions_core/core/run_command.lua:25: in function 'run_command'
2023-01-10 08:35:05: ERROR[Main]:   ...itions\worldeditadditions_core/core/register_command.lua:57: in function 'func'
2023-01-10 08:35:05: ERROR[Main]:   ...nloads\Media\minetest-win64\bin\..\builtin\game\chat.lua:74: in function <...nloads\Media\minetest-win64\bin\..\builtin\game\chat.lua:48>
2023-01-10 08:35:05: ERROR[Main]:   ...ds\Media\minetest-win64\bin\..\builtin\game\register.lua:422: in function <...ds\Media\minetest-win64\bin\..\builtin\game\register.lua:406>

This is not a consistent failure as a command that will crash one time will work most of the time.

VorTechnix commented 1 year ago

The exact command I used when the crash occurred was //multi //outset h 1 //set ocean_stone //inset h 1 //set sea_lantern //shift z 4

VorTechnix commented 1 year ago

Actually I think I may have used //many too... here's the command history leading up to the crash

2023-01-10 08:31:04: ACTION[Server]: singleplayer uses worldeditadditions:cloudwand, pointing at [node under=158,2,481 above=158,3,481]
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs /multi //outset h 1 //set ocean_stone //inset h 1 //set sea_lantern //shift z 4 (time 0 of 4)
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //outset h 1
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //set ocean_stone
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //inset h 1
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //set sea_lantern
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //shift z 4
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs /multi //outset h 1 //set ocean_stone //inset h 1 //set sea_lantern //shift z 4 (time 1 of 4)
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //outset h 1
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //set ocean_stone
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //inset h 1
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //set sea_lantern
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //shift z 4
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs /multi //outset h 1 //set ocean_stone //inset h 1 //set sea_lantern //shift z 4 (time 2 of 4)
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //outset h 1
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //set ocean_stone
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //inset h 1
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //set sea_lantern
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //shift z 4
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs /multi //outset h 1 //set ocean_stone //inset h 1 //set sea_lantern //shift z 4 (time 3 of 4)
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //outset h 1
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //set ocean_stone
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //inset h 1
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //set sea_lantern
2023-01-10 08:31:05: ACTION[Server]: singleplayer runs //shift z 4
2023-01-10 08:34:41: ACTION[Server]: singleplayer uses worldeditadditions:cloudwand, pointing at [node under=146,2,479 above=146,3,479]
2023-01-10 08:34:42: ACTION[Server]: singleplayer uses worldeditadditions:cloudwand, pointing at [nothing]
2023-01-10 08:34:43: ACTION[Server]: singleplayer uses worldeditadditions:cloudwand, pointing at [nothing]
2023-01-10 08:34:43: ACTION[Server]: [Creatura] [ABM Spawning] Spawned 2 animalia:frog at (151,2,433)
2023-01-10 08:34:45: ACTION[Server]: singleplayer uses worldeditadditions:cloudwand, pointing at [nothing]
2023-01-10 08:34:49: ACTION[Server]: singleplayer uses worldeditadditions:cloudwand, pointing at [node under=146,2,479 above=146,3,479]
2023-01-10 08:34:50: ACTION[Server]: singleplayer uses worldeditadditions:cloudwand, pointing at [nothing]
2023-01-10 08:34:52: ACTION[Server]: singleplayer uses worldeditadditions:cloudwand, pointing at [nothing]
2023-01-10 08:35:05: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'worldeditadditions_commands' in callback on_chat_message(): ...ons\worldeditadditions_core/core/entities/pos_marker.lua:58: attempt to index a nil value
VorTechnix commented 1 year ago

@fluxionary can you provide your action log from before the crash? It would help a lot to give context.

fluxionary commented 1 year ago

@VorTechnix unfortunately i don't have that anymore, i'll spend a few minutes to see if i can't re-create it.

fluxionary commented 1 year ago

debug.txt.gz

full debug log.

what i did:

//1
//2
//line
//clearobjects
//2
//line

then boom.

VorTechnix commented 1 year ago

@fluxionary thank you very much. This will help a lot in troubleshooting the bug.

VorTechnix commented 1 year ago

I've now figured out how to make a repeatable crash as well: //scloud 2 (then punch 2 nodes to create selection area) //scloud 0 (makes WE selection area disappear and WEA selectors to appear) //reset (resets selection area) Destroy the 2 WEA markers by punching them with a pickaxe //scloud 2 (then punch 2 nodes to create selection area) //scloud 0 -- Crash

2023-01-10 17:41:18: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'worldeditadditions_commands' in callback on_chat_message(): ...ons\worldeditadditions_core/core/entities/pos_marker.lua:58: attempt to index a nil value
2023-01-10 17:41:18: ERROR[Main]: stack traceback:
2023-01-10 17:41:18: ERROR[Main]:   ...ons\worldeditadditions_core/core/entities/pos_marker.lua:58: in function 'delete'
2023-01-10 17:41:18: ERROR[Main]:   ...tions\worldeditadditions_core/core/pos_marker_manage.lua:64: in function 'next_func'
2023-01-10 17:41:18: ERROR[Main]:   ...Additions\worldeditadditions_core/utils/EventEmitter.lua:65: in function 'emit'
2023-01-10 17:41:18: ERROR[Main]:   ...\WorldEditAdditions\worldeditadditions_core/core/pos.lua:37: in function 'compat_worldedit_pos1_get'
2023-01-10 17:41:18: ERROR[Main]:   ...\WorldEditAdditions\worldeditadditions_core/core/pos.lua:137: in function 'count'
2023-01-10 17:41:18: ERROR[Main]:   ...itAdditions\worldeditadditions_core/core/run_command.lua:25: in function 'run_command'
2023-01-10 17:41:18: ERROR[Main]:   ...itions\worldeditadditions_core/core/register_command.lua:57: in function 'func'
2023-01-10 17:41:18: ERROR[Main]:   ...nloads\Media\minetest-win64\bin\..\builtin\game\chat.lua:74: in function <...nloads\Media\minetest-win64\bin\..\builtin\game\chat.lua:48>
2023-01-10 17:41:18: ERROR[Main]:   ...ds\Media\minetest-win64\bin\..\builtin\game\register.lua:422: in function <...ds\Media\minetest-win64\bin\..\builtin\game\register.lua:406>
sbrl commented 1 year ago

Found a bug! I pushed a fix - does this fix it for you? If not, I'll take a deeper look.

Dealing with entities is quite fiddly, as it turns out.

Sorry this has taken so long to address, gonna update my notification system.

sbrl commented 1 year ago

Really fixed it this time :P

If this is still an issue, comment and we'll reopen.

fluxionary commented 1 year ago

@sbrl it's alright to leave things open until you've give the person who opened the issue a chance to test it. i will test it now, probably you fixed it, but it's always good to get verification.

fluxionary commented 1 year ago

tested, and it seems to not crash when doing simple things :+1: