42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
294 stars 60 forks source link

Segfault when sopel bot connects #324

Closed dromer closed 4 years ago

dromer commented 4 years ago

So, I just migrated our matterircd to a docker setup using the latest 42wim/matterircd.

It seems to work fine to connect from irssi. Things seemed to be working for the past ~12 hours, however (since just now) when I connect my sopel bot (https://github.com/sopel-irc/sopel) the entire server segfaults:

irc_1  | time="2020-10-11T12:40:46Z" level=info msg="New connection: 192.168.0.1:56240" module=matterircd
irc_1  | panic: runtime error: invalid memory address or nil pointer dereference
irc_1  | [signal SIGSEGV: segmentation violation code=0x1 addr=0xd0 pc=0x85a019]
irc_1  | 
irc_1  | goroutine 58 [running]:
irc_1  | github.com/42wim/matterircd/mm-go-irckit.CmdPrivMsg(0xa4c6c0, 0xc0003a60d0, 0xc0003d8000, 0xc0003a25f0, 0xc0003ca2d0, 0x1)
irc_1  |        /go/src/github.com/42wim/matterircd/mm-go-irckit/server_commands.go:412 +0x999
irc_1  | github.com/42wim/matterircd/mm-go-irckit.commands.Run(0xc0003b80c0, 0xa4c6c0, 0xc0003a60d0, 0xc0003d8000, 0xc0003a25f0, 0x0, 0x0)
irc_1  |        /go/src/github.com/42wim/matterircd/mm-go-irckit/commands.go:55 +0x135
irc_1  | github.com/42wim/matterircd/mm-go-irckit.(*server).handle.func1(0xc0003a60d0, 0xc0003d8000, 0xc0003a25f0)
irc_1  |        /go/src/github.com/42wim/matterircd/mm-go-irckit/server.go:362 +0x7a
irc_1  | created by github.com/42wim/matterircd/mm-go-irckit.(*server).handle
irc_1  |        /go/src/github.com/42wim/matterircd/mm-go-irckit/server.go:361 +0xe5
mattermost-docker-ifm_irc_1 exited with code 2
dromer commented 4 years ago

Hmmm, in the log of the bot I see this:

[2020-10-11 12:53:55,870] sopel.irc.backends   INFO     - Connection accepted by the server...                                                                                                                                        
[2020-10-11 12:53:55,870] sopel.irc            INFO     - Connected.                                               
[2020-10-11 12:53:55,876] sopel.coretasks      INFO     - Joining 1 channels (with JOIN throttle OFF); this may take a moment.
[2020-10-11 12:53:55,891] sopel.bot            ERROR    - Unexpected error (__new__() missing 1 required positional argument: 'version') from matterircd at 2020-10-11 12:53:55.891745. Message was: matterircd 0.20.2-dev o o debugmo
de false                                                                                                           
Traceback (most recent call last):                                                                                 
  File "/home/sopel/.local/lib/python3.8/site-packages/sopel-7.0.6-py3.8.egg/sopel/bot.py", line 606, in call                                                                                                                         
    exit_code = func(sopel, trigger)                                                                                                                                                                                                  
  File "/home/sopel/.local/lib/python3.8/site-packages/sopel-7.0.6-py3.8.egg/sopel/coretasks.py", line 228, in parse_reply_myinfo
    bot._myinfo = MyInfo(*trigger.args[0:3])                                                                                                                                                                                          
TypeError: __new__() missing 1 required positional argument: 'version' 
dromer commented 4 years ago

For now I went with the 0.19.1 image which doesn't seem to give this issue for me (the sopel bot still raises the error, but matterircd doesn't crash because of it ;) )

42wim commented 4 years ago

Should be fixed in master, please let me know if still an issue.