Skip to content
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

pidgin keeps crashing #288

Closed
iv4nhoe opened this issue Apr 3, 2020 · 25 comments
Closed

pidgin keeps crashing #288

iv4nhoe opened this issue Apr 3, 2020 · 25 comments

Comments

@iv4nhoe
Copy link
Collaborator

iv4nhoe commented Apr 3, 2020

I'm encountering seemingly random crashes of pidgin. Here's a backtrace of one of those crashes.

(gdb) bt 
#0  0x00007fffddd9a245 in ssl_nss_read (gsc=0x555557757910, data=0x5555577569b0, len=1)
    at ././libpurple/plugins/ssl/ssl-nss.c:596
#1  0x00007fffdc141da1 in discord_socket_got_data (userdata=0x555557756940, conn=0x555557757910, cond=<optimized out>)
    at libdiscord.c:4501
#2  0x00005555555c955e in pidgin_io_invoke (source=<optimized out>, condition=<optimized out>, data=0x5555558c9660)
    at ././pidgin/gtkeventloop.c:73
#3  0x00007ffff551d285 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff551d650 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff551d962 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff67d4a37 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#7  0x000055555558f8a3 in main (argc=<optimized out>, argv=<optimized out>) at ././pidgin/gtkmain.c:938
(gdb) f 1
#1  0x00007fffdc141da1 in discord_socket_got_data (userdata=0x555557756940, conn=0x555557757910, cond=<optimized out>)
    at libdiscord.c:4501
4501		while (ya->frame || (read_len = purple_ssl_read(conn, &ya->packet_code, 1)) == 1) {

Pidgin 2.12.0 (libpurple 2.12.0)
purple-discord version is the current git master

@alexolog
Copy link

alexolog commented Apr 3, 2020

I;m also getting crashes on ssl-nss, but on Windows:

Call stack:
542221D2 C:\Program Files (x86)\Pidgin\plugins\ssl-nss.dll
         C:\Program Files (x86)\Pidgin\pidgin.dll [2.13.0.0]
5CAEFAB4 C:\Program Files (x86)\Pidgin\pidgin.dll  pidgin_docklet_uninit
         C:\Program Files (x86)\Pidgin\Gtk\bin\libglib-2.0-0.dll [2.28.8.0]
685EB90D C:\Program Files (x86)\Pidgin\Gtk\bin\libglib-2.0-0.dll  g_main_context_dispatch
685EBD9D C:\Program Files (x86)\Pidgin\Gtk\bin\libglib-2.0-0.dll  g_main_loop_run
         C:\Program Files (x86)\Pidgin\Gtk\bin\libgtk-win32-2.0-0.dll [2.16.6.0]
61854260 C:\Program Files (x86)\Pidgin\Gtk\bin\libgtk-win32-2.0-0.dll  gtk_main

@petermolnar
Copy link

Same here.

@FalcoGer
Copy link

FalcoGer commented Apr 3, 2020

Same here. Pidgin crashes on ubuntu 19.04

(gdb) bt full
#0  0x00007fffd1b5a245 in  () at /usr/lib/purple-2/ssl-nss.so
#1  0x00007fffc4299da1 in discord_socket_got_data (userdata=0x555556615270, conn=0x555556612c00, cond=<optimized out>)
    at libdiscord.c:4501
        ya = 0x555556615270
        length_code = 22 '\026'
        read_len = <optimized out>
        done_some_reads = 1
#2  0x00005555555c955e in  ()
#3  0x00007ffff551d285 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff551d650 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff551d962 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff67d4a37 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#7  0x000055555558f8a3 in main ()

commit: 4e71974
Pidgin 2.12.0 (libpurple 2.12.0)

@MapleStoryPSN
Copy link

Can also confirm it crashes on Windows.

@EionRobb
Copy link
Owner

EionRobb commented Apr 3, 2020

Is someone able to get a debug log from before the crash by running pidgin from the command prompt/terminal with the --debug flag?

@ghost
Copy link

ghost commented Apr 3, 2020

...
discord: got frame data: {"t":null,"s":null,"op":7,"d":null}
dnsquery: Performing DNS lookup for gateway.discord.gg
Pidgin 2.13.0 has segfaulted and attempted to dump a core file.
...

@petermolnar
Copy link

petermolnar commented Apr 3, 2020

(21:36:06) discord: got frame data: {"t":"GUILD_MEMBER_LIST_UPDATE", [ VALID JSON HERE ]}                          
(21:36:08) discord: got frame data: {"t":null,"s":null,"op":7,"d":null}                                                                                                                                              
(21:36:08) proxy: No environment settings found, not using a proxy                                                                                                                                                   
(21:36:08) dnsquery: Performing DNS lookup for gateway.discord.gg                                                                                                                                                    
Pidgin 2.13.0 has segfaulted and attempted to dump a core file.                                                                                                                                                      

EDIT
The log contained a few lines like this:

(Pidgin:11681): Json-CRITICAL **: 21:27:19.651: json_object_get_object_member: assertion 'JSON_NODE_HOLDS_OBJECT (node) || JSON_NODE_HOLDS_NULL (node)' failed

Additional data:
all accounts were off, only discord running; pidgin is 2.13 of https://github.com/CkNoSFeRaTU/pidgin built as ./configure --prefix=/usr --disable-perl --disable-nm --with-static-prpls=jabber,irc --enable-gnutls=no

@alexolog
Copy link

alexolog commented Apr 3, 2020

On Windows:

(16:09:04) discord: got frame data: {"t":null,"s":null,"op":7,"d":null}
(16:09:04) dnsquery: Performing DNS lookup for gateway.discord.gg

Then the log ends.

@EionRobb
Copy link
Owner

EionRobb commented Apr 3, 2020

Thanks all. The t: null is an unexpected response when the connection reconnects, but regardless should be checked for so that pidgin doesn't crash. Sorry about that.

@pabs3
Copy link
Collaborator

pabs3 commented Apr 3, 2020

FTR, bug Debian#955635 was reported about this issue and it contains a pidgin patch that also prevents the crashes. I think purple-discord needs to be fixed, but pidgin needs to be more robust in the face of plugins with bugs like this, so I'm suggesting that they also send their patch upstream.

@sthibaul
Copy link

sthibaul commented Apr 3, 2020

I have forwarded the patch to https://bitbucket.org/pidgin/main/pull-requests/679/

@EionRobb
Copy link
Owner

EionRobb commented Apr 4, 2020

Not sure what's causing it but dec5015 should workaround it for now. https://eion.robbmob.com/libdiscord.dll has been updated to patch it too

@alexolog
Copy link

alexolog commented Apr 4, 2020

Still crashing with the new DLL:

Error occured on Friday, April 3, 2020 at 12:06:37.

Windows Version 6.2 Build 9200 

C:\Program Files (x86)\Pidgin\pidgin.exe caused an Access Violation at location 5acb21d2 in module C:\Program Files (x86)\Pidgin\plugins\ssl-nss.dll Reading from location 00000004.

Registers:
eax=00000000 ebx=00000000 ecx=00000001 edx=09a1ea18 esi=00000000 edi=5ca22b5c
eip=5acb21d2 esp=0061ecd0 ebp=0061edc8 iopl=0         nv up ei pl zr na po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246

Call stack:
5ACB21D2 C:\Program Files (x86)\Pidgin\plugins\ssl-nss.dll
         C:\Program Files (x86)\Pidgin\pidgin.dll [2.13.0.0]
5CAEFAB4 C:\Program Files (x86)\Pidgin\pidgin.dll  pidgin_docklet_uninit
         C:\Program Files (x86)\Pidgin\Gtk\bin\libglib-2.0-0.dll [2.28.8.0]
685EB90D C:\Program Files (x86)\Pidgin\Gtk\bin\libglib-2.0-0.dll  g_main_context_dispatch
685EBD9D C:\Program Files (x86)\Pidgin\Gtk\bin\libglib-2.0-0.dll  g_main_loop_run
         C:\Program Files (x86)\Pidgin\Gtk\bin\libgtk-win32-2.0-0.dll [2.16.6.0]
61854260 C:\Program Files (x86)\Pidgin\Gtk\bin\libgtk-win32-2.0-0.dll  gtk_main

@EionRobb
Copy link
Owner

EionRobb commented Apr 5, 2020

Ok, I've wrapped all purple_ssl_read()s in 4ccc5b9 until libpurple gets the patch fix applied. There's a new dll at https://eion.robbmob.com/libdiscord.dll too

@pabs3
Copy link
Collaborator

pabs3 commented Apr 5, 2020

With the new workaround I cannot connect to discord at all.

The logs are now showing this error during the initial connection:

(08:18:32) discord: got frame data: {"t":null,"s":null,"op":10,"d":{"heartbeat_interval":41250,"_trace":["[\"gateway-prd-main-zb70\",{\"micros\":0.0}]"]}}
(08:18:32) discord: sending frame: {"op":2,"d":{"token":<removed>,"compress":false,"large_threshold":25000,"properties":{"os":"Linux","browser":"Pidgin"},"presence":{"status":"online"},"guild_subscriptions":true}}
(08:18:32) discord: got errno 11, read_len 0 from websocket thread
(08:18:32) connection: Connection error on <removed> (reason: 0 description: Lost connection to server)

@EionRobb
Copy link
Owner

EionRobb commented Apr 5, 2020

Sorry @pabs3 my bad. Latest commit should fix that

@alexolog
Copy link

alexolog commented Apr 5, 2020

Thank you Eion. Please let us know when a new DLL is out.

@EionRobb
Copy link
Owner

EionRobb commented Apr 5, 2020

@alexolog it already worked on Windows, oddly. Tested it before uploading. Uploaded another dll anyway, just in case

@pabs3
Copy link
Collaborator

pabs3 commented Apr 5, 2020 via email

@klikevil
Copy link

This was probably with the previous build. I am getting the crash on windows and linux didn't build pidgin from source on windows but here is the backtrace from finch

gdb finch

#0 0x00007fffe87a815c in ssl_gnutls_read (gsc=0x555555664000, data=0x5555559cf520, len=1) at ssl-gnutls.c:456
#1 0x00007fffeafa3aa1 in discord_socket_got_data (userdata=0x5555559cf4b0, conn=0x555555664000, cond=)
at libdiscord.c:3564
#2 0x000055555557e0e2 in purple_gnt_io_invoke (source=, condition=, data=0x555555a302a0)
at finch.c:181
#3 0x00007ffff768062d in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#4 0x00007ffff7680aa0 in ?? () from /usr/lib64/libglib-2.0.so.0
#5 0x00007ffff7681082 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#6 0x0000555555569454 in main (argc=1, argv=0x7fffffffdc58) at finch.c:457
(gdb)

@EionRobb
Copy link
Owner

Yup. Looks like from previous build. Can you recompile and retest? The dll at https://eion.robbmob.com/libdiscord.dll will be up to date with the fix too, so you don't have to build it yourself

@klikevil
Copy link

I just got a crash with the one from the nightly, i'll test that one and let you know :)

@klikevil
Copy link

Yeah that one crashed too after about 21 minutes being connected to multiple discord servers.

@iv4nhoe
Copy link
Collaborator Author

iv4nhoe commented Apr 14, 2020

Sorry @pabs3 my bad. Latest commit should fix that

I haven't experienced any crashes with db7dc79 anymore.
As far as I'm concerned this issue is fixed.

@EionRobb
Copy link
Owner

@klikevil your one seems to be to do with gnutls when the others are to do with libnss. Let's start. Anew issue and close this one off

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

No branches or pull requests

9 participants