minetest-mods / irc

IRC Mod for Minetest
BSD 2-Clause "Simplified" License
43 stars 31 forks source link

"irc_msg <playername> ." seems to have caused a crash #18

Closed deezl closed 8 years ago

deezl commented 9 years ago

A player on our BL-Pro server tried to send a PM to me on IRC from the server, and managed to get a period at the end of the command, after a space. The following is what I grepped from debug:

15:57:54: ERROR[main]: ERROR: An unhandled exception occurred: ...test/bin/../games/bluelobster_game/mods/irc/chatcmds.lua:24: attempt to index a nil value
15:57:54: ERROR[main]: stack traceback:
15:57:54: ERROR[main]:  ...test/bin/../games/bluelobster_game/mods/irc/chatcmds.lua:24: in function 'func'
15:57:54: ERROR[main]:  ...chaoswormz/minetest/bin/../builtin/game/chatcommands.lua:40: in function <...chaoswormz/minetest/bin/../builtin/game/chatcommands.lua:29>
15:57:54: ERROR[main]:  /home/chaoswormz/minetest/bin/../builtin/game/register.lua:341: in function </home/chaoswormz/minetest/bin/../builtin/game/register.lua:329>
deezl commented 9 years ago

ok, added info, it did not have to have the space or the period, a simple "/irc_msg deezl test" caused an immediate crash. This is only the latest in a series of bugs we have been experiencing with the irc and irc_commands mods. I will open a seperate issue for the other major one.

ShadowNinja commented 9 years ago

Related to ShadowNinja/minetest-irc_commands#2.

I'm not sure what causes this. Can you break up the relevant line into a few lines to find out exactly what is nil? This might be caused by an old and/or buggy version of LuaIRC.

deezl commented 9 years ago

I'm not entirely sure what you are asking about breaking up the relevant line into a few lines. The odd part about this issue, is that there are 3 other servers on the same machine, running the same version of the mod (although one is running current git of minetest_game, another is running carbone, and yet another is running a slightly older version of minetest_game) yet they do not have the same problem. Have attempted deleting and re- git pulling the irc and irc_commands mods, to no avail.

ShadowNinja commented 9 years ago

@deezl: Like so:

for nick, user in pairs(irc.conn.channels[irc.config.channel].users) do
-- Becomes:
local conn = irc.conn
assert(conn, "Connection is nil")
local chans = conn.channels
assert(chans, "Channels are nil")
local cfg = irc.config
assert(cfg, "Configuration is nil")
local chan = chans[cfg.channel]
assert(chan, "Channel is nil")
for user, nick in pairs(chan.users) do
kaeza commented 8 years ago

Is this still a problem?

deezl commented 8 years ago

wow, I had actually forgotten about this bug. I haven't been on that server in quite a long time, so I'm not sure if it's still an active issue. It has been moved around to different IRC servers a few times now, I will check with the current owner to see if this has been a problem since.

kaeza commented 8 years ago

@deezl Any news?