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

[BUG] Server crash #39

Closed
ChaosWormz opened this issue Apr 19, 2014 · 4 comments
Closed

[BUG] Server crash #39

ChaosWormz opened this issue Apr 19, 2014 · 4 comments

Comments

@ChaosWormz
Copy link

11:54:37: ERROR[main]: ERROR: An unhandled exception occurred: ...test/mods/Minetest-WorldEdit/worldedit_commands/init.lua:36: bad argument #1 to 'chat_send_player' (string expected, got nil)
11:54:37: ERROR[main]: stack traceback:
11:54:37: ERROR[main]: [C]: in function 'chat_send_player'
11:54:37: ERROR[main]: ...test/mods/Minetest-WorldEdit/worldedit_commands/init.lua:36: in function 'player_notify'
11:54:37: ERROR[main]: ...test/mods/Minetest-WorldEdit/worldedit_commands/safe.lua:42: in function 'func'
11:54:37: ERROR[main]: /usr/share/minetest/builtin/chatcommands.lua:25: in function </usr/share/minetest/builtin/chatcommands.lua:16>
11:54:37: ERROR[main]: /usr/share/minetest/builtin/misc_register.lua:348: in function </usr/share/minetest/builtin/misc_register.lua:336>

In thread b6c96700:
/build/buildd/minetest-201404190451/src/main.cpp:1887: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD b4bffb40:
#0 virtual void* CurlFetchThread::Thread()

DEBUG STACK FOR THREAD b6c96700:
#0 int main(int, char**)

(Leftover data: #1 Dedicated server branch)
(Leftover data: #2 virtual void ServerMap::save(ModifiedState))
(Leftover data: #3 virtual void Database_SQLite3::saveBlock(MapBlock*))
(Leftover data: #4 void ItemStack::serialize(std::ostream&) const)

@SmallJoker
Copy link

https://github.com/Uberi/Minetest-WorldEdit/blob/master/worldedit_commands/safe.lua#L39
line must be called

func = function(name, param)

same with L61

@khonkhortisan
Copy link
Contributor

//y and //n do not use (name, param) from the chatcommand. Instead, they get whatever was saved by safe_region.
It is assumed that someone gets the safe_region message before running //y, which is why it crashes when there's nothing in safe_region_name.
Also, it is assumed that there will only be one person with confirmation waiting:
personA sets a large region, then runs //fixlight, getting the prompt.
personB sets a similar large region, then runs //fixlight, also getting the prompt. personA's to-do list is cleared.
personB runs //y, actually doing .fixlight, and clearing the to-do list again.
personA runs //y on an empty to-do list, getting a crash.
First, it must do nothing if safe_region_callback, safe_region_name, and safe_region_param have been emptied or never filled.
Second, they must be turned into tables with player name as the key, so that two players using safe_region and //y or //n don't interfere with each other.

@Uberi
Copy link
Owner

Uberi commented Apr 20, 2014

Oops, my bad, I'll get on that ASAP.

@Uberi
Copy link
Owner

Uberi commented Apr 20, 2014

Fixed in 4660927! Thanks for the report ChaosWormz and thanks for the explanation khonkhortisan.

@Uberi Uberi closed this as completed Apr 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants