-
Notifications
You must be signed in to change notification settings - Fork 64
Tiny panicks when connecting to irc.gitter.im #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for reporting. Could you run
It'd be even more helpful if you could try this with a debug build, e.g. build tiny as described in README, then in the same directory
|
I'll try with a debug build later, but in the meantime, here is the backtrace with the normal build, in case it helps:
|
I can reproduce this locally. First of all here's a problem with tiny that is not specific to this bug: in case of a panic in a task we should really abort. I don't know how tiny can continue operating after a panic (after all, we don't spawn any threads, and AFAIK you can only catch panics in thread boundaries), but it clearly can, as otherwise there would be at most one panic reported in stderr in a panic. Currently I get three panics, I think only the first one is relevant (others are chain reaction) so only pasting that: Backtrace
The bug is in this function: /// Try to parse servername in a 002 RPL_YOURHOST reply
fn parse_servername(params: &[String]) -> Option<String> {
let msg = params.get(1).or_else(|| params.get(0))?;
let slice1 = &msg[13..];
let servername_ends = slice1.find('[').or_else(|| slice1.find(','))?;
Some((&slice1[..servername_ends]).to_owned())
} Here the magic number
Apparently this server doesn't follow this format. The function Reminder: the server name parsed in this function is used when pinging the server when we don't hear from it for a while. If we can't parse server name of a server then |
The full
This doesn't have a server name so I don't know how to ping this server. I guess we won't ping it for now. Though I now realize that if we never ping we may incorrectly think that the connection has timed out and reconnect. Pings are how we currently check connectivity when we don't hear from a server for a while. |
Per RFC 2812, reply 002 should look like Your host is <servername>, running version <ver> But this doesn't hold for some servers, see #211.
I just pushed a commit, Assertion failure
|
The Should be like this I think :
Edit: To me it seems like this is the server's fault? They should be sending the message like One more edit: |
@trevarj thanks for the investigation. I think you're right that this is the server's fault. In any case, I updated the message handler code now so we now ignore messages that are not in the expected format instead of panicking. @Kabouik you should be able to connect to this server now. Let me know if you encounter any other problems. |
Thanks a lot! I can confirm it now works. There's something that I think is new in the
Also, I was initially using |
So the "Logger error" part is expected: it happens when the logger encounters an IO error during a log operation. In your case it seems like it can't open a file. Did you remove the log directory after starting tiny?
Interesting, I use both libraries and never had any problems. I just tried connecting to irc.gitter.im using rustls and it worked fine. Which server are you trying to connect when you get panic messages? The story with reporting panics is not great, unfortunately. I've recently opened #212 to fix that. |
No, the log directory is still here and I didn't touch its permsisions, so I'm not sure what changed. I compiled Ok, I saw #212 later indeed! |
I think the issue might be related to Gitter rooms being formatted with a slash in their name, which must conflict with the way I built
I couldn't copy everything due to the broken TUI, sorry. However I think it's just the same message repeated several times. |
Thanks @Kabouik, I moved the issue with logging to #214. I'm a bit confused about the TLS error. The lines you pasted seem to be log lines, not panics, right? So you run tiny with Btw, panics and log lines are printed to stderr not stdout, so you can do this to avoid those to break the TUI:
Then look at the file |
Confirmed that you can't connect to irc.rizon.net using rustls. I'll open an issue about this. |
Sorry I didn't see my emails earlier. Do you still need me to do this, or did you check already before opening #215? |
No worries -- I already checked that, yes. |
Maybe I didn't configure it correctly, but if so I couldn't find what parameter is wrong and causing this issue:
I tried with or without nicknames listed in
nicks
, with or without the channel, but no difference.I followed instructions at https://irc.gitter.im/.
The text was updated successfully, but these errors were encountered: