sm00th / bitlbee-discord

Bitlbee plugin for Discord (http://discordapp.com)
GNU General Public License v2.0
290 stars 27 forks source link

Bitlbee hangs with libevent, glib event loop conflict? #62

Closed digitalcircuit closed 7 years ago

digitalcircuit commented 7 years ago

Steps to reproduce:

  1. Connect to Discord in Bitlbee
  2. Wait for Discord to disconnect
  3. Bitlbee hangs

What happens

<root> discord - Error: Failed to read data.
<root> discord - Signing off..
<root> discord - Reconnecting in 5 seconds..
<-- digitalcircuit (quassel@localhost) has quit (No Ping reply in 180 seconds.)

What should happen Reconnects without hang.

According to discussion with dx on IRC, Bitlbee-Discord shouldn't use the glib event loop as it conflicts with the Bitlbee libevent event loop. Introduced by the v6 API commit.

More content to be added. See OFTC/#bitlbee for conversation on 2016-12-20 10 pm-ish EST

Backtrace

(gdb) backtrace
#0  0x00007fa28bc84b40 in __poll_nocancel () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fa28cc1939c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fa28cc194ac in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fa289c7de0e in ?? () from /usr/lib/bitlbee/discord.so
#4  0x00007fa289c7e936 in discord_parse_message () from /usr/lib/bitlbee/discord.so
#5  0x00007fa289c804bb in ?? () from /usr/lib/bitlbee/discord.so
#6  0x000056519504dcef in b_event_passthrough (fd=11, event=<optimized out>, data=0x565196b96d40) at /tmp/buildd/bitlbee-3.4.2+20161128+master+93-g0483e1e/lib/events_libevent.c:143
#7  0x00007fa28c996a0c in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#8  0x000056519504d870 in b_main_run () at /tmp/buildd/bitlbee-3.4.2+20161128+master+93-g0483e1e/lib/events_libevent.c:84
#9  0x0000565195037e1d in main (argc=<optimized out>, argv=0x7ffe340bcbc8) at /tmp/buildd/bitlbee-3.4.2+20161128+master+93-g0483e1e/unix.c:182
sm00th commented 7 years ago

Removed it in the latest commit, it shouldn't break anything, but I'm keeping an eye on it.

I wonder why it only breaks things on reconnect for you though as it should be called on initial connect as well.