Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Playbot crashes when you shrug #281

Open
Manishearth opened this issue Mar 16, 2017 · 5 comments
Open

Playbot crashes when you shrug #281

Manishearth opened this issue Mar 16, 2017 · 5 comments

Comments

@Manishearth
Copy link
Member

Just say ¯\_(ツ)_/¯ in a channel with playbot in it.

Playbot will respect your apathy and leave/rejoin.

cc @alexcrichton

@Manishearth
Copy link
Member Author

Manishearth commented Mar 17, 2017

This is because my IRC client is sending the U+00AF MACRON as a one-byte bit of invalid unicode (instead of 0xC2AF)

@Manishearth
Copy link
Member Author

Okay, this is really weird. It's a bug in the irc crate or the network stack, and only occurs when it has received a macron over the network.

The following code does it. It has to be run with logger. ./bin | logger -t playbot, followed by sending \xAF over IRC. I suspect the IO stack goes boom for some reason. Idk.

extern crate irc;


use std::default::Default;
use irc::client::prelude::*;

fn main() {
    let cfg = Config {
        nickname: Some(format!("irctest2")),
        server: Some(format!("irc.mozilla.org")),
        channels: Some(vec![format!("#testchan")]),
        .. Default::default()
    };
    let server = IrcServer::from_config(cfg).unwrap();
    server.identify().unwrap();
    let name = "playbot";
    for message in server.iter() {
            let message = message.unwrap();
            match message.command {
                Command::PRIVMSG(ref to, ref msg) => {
                        println!("received");
                }
                _ => ()
            }
    }
    println!("done");
}

cc @aatxe

@Manishearth
Copy link
Member Author

I suspect rr can help here if you're on linux.

@aatxe
Copy link
Member

aatxe commented Mar 20, 2017

Can you get a backtrace or something? It'd be interesting to see where this is actually a problem.

@Manishearth
Copy link
Member Author

No, there is no backtrace. But you can reproduce it with the above minimal IRC bot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants