minetest.chat_send_player crashes.

User avatar
Sane
Member
 
Posts: 103
Joined: Tue Jun 17, 2014 09:31
GitHub: mt-sane
In-game: Sane

minetest.chat_send_player crashes.

by Sane » Sat Aug 08, 2015 18:39

A call to minetest.chat_send_player crashes the application when called in init.lua.

using minetest-0.4.12-7a6e4dc (sfan5's build)
on windows.

Steps to reproduce:
o Set ... games\minimal\mods\test\init.lua to:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
print("--------------------- starting test.")
minetest.chat_send_player("singleplayer", "Help me I crashed ...")
print("--------------------- never seen.")
o Start a game.

Resulting debug.txt:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all

-------------
  Separator 
-------------

--------------------- starting test.
Trying to stay me.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: minetest.chat_send_player crashes.

by rubenwardy » Sat Aug 08, 2015 21:20

On testing, this causes a SegFault:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
--------------------- starting test.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000750688 in Environment::getPlayer(char const*) ()
(gdb) backtrace
#0  0x0000000000750688 in Environment::getPlayer(char const*) ()
#1  0x00000000008d5cb8 in Server::notifyPlayer(char const*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) ()
#2  0x000000000063baad in ModApiServer::l_chat_send_player(lua_State*) ()
#3  0x00000000005e7f06 in script_exception_wrapper(lua_State*, int (*)(lua_State*)) ()
#4  0x00007ffff65f3af1 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
#5  0x00007ffff6636d00 in lua_pcall ()
   from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
#6  0x00000000005ecfbd in ScriptApiBase::loadScript(std::string const&, std::string*) ()
#7  0x00000000005ed1b2 in ScriptApiBase::loadMod(std::string const&, std::string const&, std::string*) ()
#8  0x00000000008e027e in Server::Server(std::string const&, SubgameSpec const&, bool, bool) ()
#9  0x0000000000777ae4 in Game::createSingleplayerServer(std::string, SubgameSpec const&, unsigned short, std::string*) ()
#10 0x0000000000777f55 in Game::init(std::string const&, std::string*, unsigned short, SubgameSpec const&) ()
#11 0x0000000000782f58 in the_game(bool*, bool, InputHandler*, irr::IrrlichtDevice*, std::string const&, std::string const&, std::string const&, std::string const&, unsigned short, std::string&, ChatBackend&, bool*, SubgameSpec const&, bool


I happens when it tries to access a non-existant player (as singleplayer hasn't joined yet). This definitely shouldn't happen.

Don't worry, I'm on it :P
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 3 guests

cron