DALnet / bahamut

The Bahamut IRC Daemon
http://www.dal.net/?page=Bahamut
Other
57 stars 42 forks source link

Long messages with multi-byte utf-8 characters are dropped and "crash the sendq" #196

Open progval opened 3 years ago

progval commented 3 years ago

Hi,

I was playing around with byte limits, and I noticed the following bug:

  1. nick1 sends: privmsg nick2 :aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (this is a 512 bytes message including \r\n)
  2. nick2 receives it, but truncated so it fits in 512 bytes after prepending the NUH. All good for now.
  3. nick1 sends: privmsg nick2 :aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa😃 (this is, again, 512 bytes including '\r\n`)
  4. nick2 does not receive it, not even truncated
  5. the server no longer sends anything to nick1: no reply to nick1 commands, or messages from user users. However, commands sent by nick1 are still interpreted (eg. nick1 can send messages to other users)

Tested on istana.il.us.dal.net, running version bahamut-2.1.6

github-actions[bot] commented 3 years ago

Thanks for submitting your first issue! A member of the DALnet coder team will label it appropriately and provide follow-up

eaescob commented 3 years ago

Thanks for reporting this. Do you happen to have the code so we can replicate it?

progval commented 3 years ago

You can copy-paste the messages above in a telnet session (mind the nick length though).

Alternatively, you can make sure ircd is findable with $PATH, clone this repository: https://github.com/ProgVal/irctest , cd to it, and run pytest --controller=irctest.controllers.bahamut -k 'buffering and charperchar' -s -v -x (that's how I initially found the issue), but it's not very convenient to use for this