EionRobb / purple-discord

A libpurple/Pidgin plugin for Discord
GNU General Public License v3.0
380 stars 43 forks source link

Discord DM with approx 2 lines of text randomly crashes Pidgin #435

Closed katajanmarja closed 1 year ago

katajanmarja commented 1 year ago

Hi, Eion! Happy holidays!

I'm trying to figure out how on earth to even start debugging this but wanted to leave a placeholder report to get started so we can collect observations in one place in case there's multiple. Running version: 0.9.2022.02.17.git.df61f37-1 on Ubuntu

Introduction time: I've seen this effect for a long time, probably when I first installed already, but I haven't used Pidgin-side so often before the browser-side Discord started to malfunction worse (suspect that Firefox is tripling letters (does it here too) and web-Discord's JS can't seem to keep up with my typing). I generally run both in parallel.

Symptom: When I start to write a longer explanation into a Discord DM in a Pidgin message window, after a while (approx 2 lines in the message buffer before ever pressing send) it seems to 'often' happen that the window freezes and I get the Pidgin is not responding, force quit or wait? popup from the window manager. (It never recovers.)

TODO self: Is there some kind of network communications going on there that I could potentially turn off, should I drop the managed version and pull & deploy from git directly (if something related to this has any time recently changed), is there some debug log I could activate for getting a more useful report.

EionRobb commented 1 year ago

Out of interest, what version of Pidgin?

I know grim has been working on an annoying Pidgin bug to do with the UI getting into an infinite loop of trying to resize itself with and without scroll bars, which I want to guess at saying has been resolved in the very latest Pidgin.

I guess to rule that out, can you try the same text into a chat or DM on a protocol that's not Discord and see if it does the same?

katajanmarja commented 1 year ago

1:2.14.8-1ubuntu2 - that might actually relate to resizing if it affects the window I'm typing into somehow.

It's not completely predictable, sadly, right now I can't reproduce with a Discord DM either when Pidgin's been freshly restarted from the crash. I'll try again tomorrow - in case it has something to do with e.g. suspending and starts to reproduce after that, I will get two tries naturally from how the day goes to confirm that pattern.

katajanmarja commented 1 year ago

Thanks for the tip!

It is not related to suspend - it is related to typing speed. I can't reproduce it if I try to measure the length of the string at the same time by copying it, and I can't reproduce it usually in the XMPP network because there are relatively few conversations where I really start to do autistic infodump that produces the typing speed necessary to reach this bug.

XMPP typing window has meanwhile turned a bit weird, the font is tiny compared to typing into the Discord window (go figure), BUT when the message reached two-three lines yes indeedy it crashes there too - exactly when it should react to the text not quite fitting entirely into view any more.

So this is not actually Discord-specific, it's just been my typing speed that is Discord-plugin-use specific. Now that I managed to crash it immediately after start I can crash the XMPP message window with the exact same method.

Next TODO: figure out how to upgrade Pidgin and how far - if you have a link to the resize bug we could dump into this thread, that would be awesome. But this bug is not in the plugin itself.

katajanmarja commented 1 year ago

Found it: it's fixed in 2.14.9 (Ubuntu 22.04 is 2.14.8) https://issues.imfreedom.org/issue/PIDGIN-17413 https://issues.imfreedom.org/issue/PIDGIN-17623/Infinite-loop-hang-when-typing-text-box-resizes-to-one-with-scroll-bar

For Ubuntu, there seems to be no obvious way to upgrade from prebuilt binary. Source it is.

Source download for 2.14.10: https://sourceforge.net/projects/pidgin/files/Pidgin/2.14.10/pidgin-2.14.10.tar.bz2/download Build instruction: https://pidgin.im/development/building/2.x.y/ Needed to install at least intltool (edit /etc/apt/sources.list to include deb-src lines and sudo apt-get build-dep pidgin). (Did configure with --disable-gevolution since not sure why Evolution headers did not appear, and did not feel like debugging.)

This makes pidgin appear in /usr/local/bin/pidgin. Can confirm with pidgin -v and from About that it's the right version.

And issue is finally gone! So to fix this problem, upgrade to 2.14.9 or newer, I tested solution with 2.14.10. :) Closing ticket, thanks a lot for the help! <3