Wuzzy wrote:Hmm, this looks like a difficult bug for me. I have looked into the HUD bars mod but was unable to find anything suspicios. What seems to be clear to me is that, for some reason, the hb.hide_hudbars function somehow got a player which is nil, therefore the name is nil, and you can't use nil as a table index.
I also have looked into the Hungry Games mods, especially survival_modpack, but I have not spotted anything suspicious there, too.
I am not even sure which mod is actually responsible for the crash, but it seems to be more likely that HUD bars is responsible, judging from the stack trace. I can't explain it otherwise for now, unless the Hungry Games does some really nasty shit, like overwriting one of HUD bar's core tables. But I don't know yet. :-(
I am also not sure if the code you pointed to is actually responsible, because it does not touch anything near that weird player object, which is nil.
Could you give me more information of the crash? If you still have the log, more context would probably help me. Please give me more text of the debug.txt before the crash. The best thing for me would be a couple of logs for several server sessions, that is, server boots, then runs for a while until the crash.
Also, do you have information on how many players were on the server when it crashed?
Also, are you able to repoduce this crash on a local test server? If so, then please tell me how.
Sadly, I can't reproduce anything of this. Maybe this is a sort of bug which only happens when you use an online server with many players, but does not happen on local servers.
Ok, after much experimenting, I've managed to reproduce this bug on a test server. The test server was running minetest 0.4.12 stable, with my fork of hungry_games, and no mods besides the ones in hungry_games.
The problem seems to arise when a player joins while the countdown to the match is ongoing. You can recreate this yourself, connect 2 clients to a server and make both of them vote to begin, then while the countdown is going on, connect another client to the server, the server crashes 100% of the time on my machine, with the following error:
- Code: Select all
21:38:42: ERROR[main]: ServerError: ...4.12/bin/../games/hungry_games/mods/hudbars/init.lua:359: attempt to index field '?' (a nil value)
21:38:42: ERROR[main]: stack traceback:
21:38:42: ERROR[main]: ...4.12/bin/../games/hungry_games/mods/hudbars/init.lua:359: in function 'hide_hudbar'
21:38:42: ERROR[main]: ...4.12/bin/../games/hungry_games/mods/hudbars/init.lua:438: in function 'update_hud'
21:38:42: ERROR[main]: ...4.12/bin/../games/hungry_games/mods/hudbars/init.lua:470: in function '?'
21:38:42: ERROR[main]: ...top/minetest-0.4.12/bin/../builtin/game/register.lua:341: in function <...top/minetest-0.4.12/bin/../builtin/game/register.lua:329>
Another thing I've noticed, is that the player joining during the countdown has a hunger and thirst hudbar, but no health hudbar.
The fact that this bug seemed to arise about 50% of the time on my hungry_games server would make sense, as there were people joining and leaving the server quite often, and statistically, it's likely that somebody would join during the 10 second countdown to the match start.