BlockMen / hunger

Hunger mechanics for Minetest; needs Better HUD (https://github.com/BlockMen/hud)
GNU Lesser General Public License v2.1
8 stars 3 forks source link

Server shutting down. #3

Closed Alvarion closed 9 years ago

Alvarion commented 9 years ago

Hi.

I add your mod into my skyblock minetest server and after few hours server fail. Here is debug from console ... can u help and find where is problem? Thx.

Minetest server is latest build from git...

2015-09-30 19:25:07: ERROR[Main]: UNRECOVERABLE error occurred. Stopping server. Please fix the following error:
2015-09-30 19:25:07: ERROR[Main]: Runtime error from mod 'hunger' in callback environment_Step(): /home/slanina/.minetest/mods/hud/api.lua:89: attempt to index local 'elem2' (a nil value)
2015-09-30 19:25:07: ERROR[Main]: stack traceback:
2015-09-30 19:25:07: ERROR[Main]:   /home/slanina/.minetest/mods/hud/api.lua:89: in function 'swap_statbar'
2015-09-30 19:25:07: ERROR[Main]:   /home/slanina/.minetest/mods/hunger/init.lua:42: in function 'func'
2015-09-30 19:25:07: ERROR[Main]:   /usr/local/share/minetest/builtin/game/misc.lua:18: in function 'update_timers'
2015-09-30 19:25:07: ERROR[Main]:   /usr/local/share/minetest/builtin/game/misc.lua:50: in function '?'
2015-09-30 19:25:07: ERROR[Main]:   /usr/local/share/minetest/builtin/game/register.lua:355: in function </usr/local/share/minetest/builtin/game/register.lua:335>

In thread 7fb1c271d840:
/run/media/slanina/efd59832-6bb1-4004-99d8-34e6eb7971e9/minetest/minetest/src/server.cpp:505: void Server::step(float): A fatal error occurred: Runtime error from mod 'hunger' in callback environment_Step(): /home/slanina/.minetest/mods/hud/api.lua:89: attempt to index local 'elem2' (a nil value)
stack traceback:
    /home/slanina/.minetest/mods/hud/api.lua:89: in function 'swap_statbar'
    /home/slanina/.minetest/mods/hunger/init.lua:42: in function 'func'
    /usr/local/share/minetest/builtin/game/misc.lua:18: in function 'update_timers'
    /usr/local/share/minetest/builtin/game/misc.lua:50: in function '?'
    /usr/local/share/minetest/builtin/game/register.lua:355: in function </usr/local/share/minetest/builtin/game/register.lua:335>
Debug stacks:
DEBUG STACK FOR THREAD 7fb1b67fd700:
#0  virtual void* EmergeThread::run()
(Leftover data: #1  MapBlock* ServerMap::loadBlock(v3s16))
(Leftover data: #2  void ServerMap::loadBlock(std::string*, v3s16, MapSector*, bool))
(Leftover data: #3  void ItemStack::deSerialize(std::istream&, IItemDefManager*))
DEBUG STACK FOR THREAD 7fb1b6ffe700:
#0  virtual void* CurlFetchThread::run()
DEBUG STACK FOR THREAD 7fb1bce18700:
#0  virtual void* ServerThread::run()
#1  void Server::Receive()
(Leftover data: #2  void Server::SendBlocks(float))
(Leftover data: #3  void RemoteClient::GetNextBlocks(ServerEnvironment*, EmergeManager*, float, std::vector<PrioritySortedBlockTransfer>&))
(Leftover data: #4  void ItemStack::serialize(std::ostream&) const)
(Leftover data: #5  bool getCraftingResult(Inventory*, ItemStack&, std::vector<ItemStack>&, bool, IGameDef*))
(Leftover data: #6  bool getCraftingResult(Inventory*, ItemStack&, std::vector<ItemStack>&, bool, IGameDef*))
(Leftover data: #7  void ItemStack::deSerialize(std::istream&, IItemDefManager*))
DEBUG STACK FOR THREAD 7fb1c271d840:
#0  int main(int, char**)
#1  Dedicated server branch
#2  void dedicated_server_loop(Server&, bool&)
#3  void Server::step(float)
(Leftover data: #4  void Server::SendAccessDenied_Legacy(irr::u16, const wstring&))
BlockMen commented 9 years ago

It is actually a bug in the hud mod, but thanks for reporting. Will be fixed soon.

BlockMen commented 9 years ago

Fixed. https://github.com/BlockMen/hud/commit/44d40a92aeef3eac5a0996e611ba6d8d39162da6