Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#8774 closed defect (fixed)

Pidgin 2.5.5+ crashes on quit with chat rooms open

Reported by: darkrain42 Owned by:
Milestone: 2.5.6 Component: libpurple
Version: 2.5.5 Keywords:
Cc:

Description (last modified by darkrain42)

khc, Maiku, and I have all experienced this crash on quit. Backtrace is from [f8e29008581f125525301f7a98874c63847b2c29].

It appears to require (at least for me) two accounts active (one AIM and one XMPP) and two chat rooms open (both on only my XMPP account and no other chats/IMs open).

Attachments (5)

backtrace.txt (6.7 KB) - added by darkrain42 9 years ago.
pidgin.RPT (5.3 KB) - added by rotanid 9 years ago.
backtrace-full.txt (15.7 KB) - added by darkrain42 9 years ago.
Crash with two accounts logged on and only two chats open (both from the one XMPP account)
crash-2.5.5-fix.patch (1.4 KB) - added by darkrain42 9 years ago.
(untested) patch for 2.5.5
crash-2.6.0mtn-fix.patch (3.3 KB) - added by darkrain42 9 years ago.

Download all attachments as: .zip

Change History (30)

Changed 9 years ago by darkrain42

comment:1 Changed 9 years ago by darkrain42

  • Milestone set to 2.6.0

comment:2 follow-up: Changed 9 years ago by rotanid

same problem with 2.5.5 here, too

comment:3 in reply to: ↑ 2 Changed 9 years ago by darkrain42

Replying to rotanid:

same problem with 2.5.5 here, too

rotanid: Please attach a backtrace for your crash? I was under the impression this started with 2.6.0devel (although I have no actual data to back that up)

Changed 9 years ago by rotanid

comment:4 follow-up: Changed 9 years ago by Paradox

Does this still occur if you disable all IRC accounts? When using 2.6.0devel-vv I get this same error when closing Pidgin (backtrace is identical to darkrain's). Last time it happened I printed out the name of the account in question and it was my freenode IRC account.

It's also possible that it happens on whichever protocol is freed first.

comment:5 in reply to: ↑ 4 ; follow-up: Changed 9 years ago by darkrain42

  • Summary changed from im.pidgin.pidgin head crashes on quit to im.pidgin.pidgin head crashes on quit with chat rooms open

rotanid: Your crash is different. Please file a separate ticket and attach your crash report to it.

Replying to Paradox:

Does this still occur if you disable all IRC accounts? When using 2.6.0devel-vv I get this same error when closing Pidgin (backtrace is identical to darkrain's). Last time it happened I printed out the name of the account in question and it was my freenode IRC account.

I don't use Pidgin for IRC. I do, however, use chat rooms with one of my XMPP accounts. The crash only occurs when a gtkconv exists that has chat rooms in it (I'd test further, but I want to go to bed and I suspect everyone in jdev and devel@cpi would rather I didn't keep quitting/joining every 15 seconds for a few minutes).

I haven't looked at the code for this, but I suspect this codepath is only triggered for chats. It also triggered when the persistent chats were hidden (I'm not familiar with the mechanism that hides them, so I dunno if that's actually helpful at all. I suspect not...)

comment:6 in reply to: ↑ 5 ; follow-up: Changed 9 years ago by QuLogic

Replying to darkrain42:

I haven't looked at the code for this, but I suspect this codepath is only triggered for chats. It also triggered when the persistent chats were hidden (I'm not familiar with the mechanism that hides them, so I dunno if that's actually helpful at all. I suspect not...)

I can't reproduce this. You have multiple XMPP accounts, right? Are there chat windows open for both? Does it still happen if you close all but the account with a chat window?

comment:7 in reply to: ↑ 6 Changed 9 years ago by darkrain42

  • Description modified (diff)

Replying to QuLogic:

I can't reproduce this. You have multiple XMPP accounts, right? Are there chat windows open for both? Does it still happen if you close all but the account with a chat window?

All the chats I'm in are all on one XMPP account. It seems to happen when I have two chats (both from my XMPP account) open and I'm also signed on to at least two accounts (the other one is AIM and has no conversation windows open).

I'll attach a debug log from that session in just a sec.

Changed 9 years ago by darkrain42

Crash with two accounts logged on and only two chats open (both from the one XMPP account)

comment:8 Changed 9 years ago by QuLogic

OK, I got it. You don't really need two accounts.

Anyway, it looks like the core uninit rearrangement is broken. It now calls purple_plugins_destroy_all before everything. But that unloads all prpl plugins. And then some other stuff is done when closing conversations (but they don't exist anymore).

A debug log is useful here:

(00:26:12) account: Disconnecting account 0x1db3e80
(00:26:12) connection: Disconnecting connection 0x2bd4380
(00:26:12) connection: Deactivating keepalive.
(00:26:12) connection: Destroying connection 0x2bd4380
(00:26:12) certificate: CertificateVerifier tls_cached unregistered
(00:26:12) certificate: CertificateVerifier singleuse unregistered
(00:26:12) certificate: CertificatePool tls_peers unregistered
(00:26:12) certificate: CertificatePool ca unregistered
(00:26:12) main: Unloading all plugins
(00:26:12) plugins: Unloading plugin SSL
(00:26:12) plugins: Unloading plugin NSS
(00:26:12) certificate: CertificateScheme x509 unregistered
(00:26:12) dbus: The signal "conversation-extended-menu" caused some dbus error. (If you are not a developer, please ignore this message.)
(00:26:12) dbus: The signal "conversation-extended-menu" caused some dbus error. (If you are not a developer, please ignore this message.)
(00:26:13) plugins: Unloading plugin Tcl Plugin Loader
(00:26:13) dbus: The signal "conversation-extended-menu" caused some dbus error. (If you are not a developer, please ignore this message.)
(00:26:13) plugins: Unloading plugin Bonjour
(00:26:13) dbus: The signal "conversation-extended-menu" caused some dbus error. (If you are not a developer, please ignore this message.)
(00:26:13) plugins: Unloading plugin IRC
(00:26:13) dbus: The signal "conversation-extended-menu" caused some dbus error. (If you are not a developer, please ignore this message.)
(00:26:13) plugins: Unloading plugin XMPP
(00:26:13) jabber: destroying hash tables for data objects
(00:26:13) dbus: The signal "conversation-extended-menu" caused some dbus error. (If you are not a developer, please ignore this message.)
(00:26:13) plugins: Unloading plugin MSN
(00:26:13) dbus: The signal "conversation-extended-menu" caused some dbus error. (If you are not a developer, please ignore this message.)
(00:26:13) plugins: Unloading plugin QQ
(00:26:13) dbus: The signal "conversation-extended-menu" caused some dbus error. (If you are not a developer, please ignore this message.)
(00:26:13) plugins: Unloading plugin Napster
(00:26:13) dbus: The signal "conversation-extended-menu" caused some dbus error. (If you are not a developer, please ignore this message.)
(00:26:13) plugins: Unloading plugin SNPP
(00:26:13) dbus: The signal "conversation-extended-menu" caused some dbus error. (If you are not a developer, please ignore this message.)
(00:26:13) Session Management: Handling closed ICE connection... 
(00:26:13) done.
(00:26:13) Session Management: Connection closed.
(00:26:13) gtkblist: removed visibility manager: 0
(00:26:13) docklet: destroyed

comment:9 Changed 9 years ago by QuLogic

I probably should have ended that with "then it crashes trying to access information from the prpl plugin".

comment:10 Changed 9 years ago by darkrain42

  • Version set to 2.5.5

We determined this should also occur in 2.5.5

comment:11 Changed 9 years ago by QuLogic

Ticket #8840 has been marked as a duplicate of this ticket.

Changed 9 years ago by darkrain42

(untested) patch for 2.5.5

comment:12 Changed 9 years ago by darkrain42

  • Component changed from pidgin (gtk) to libpurple
  • Summary changed from im.pidgin.pidgin head crashes on quit with chat rooms open to Pidgin 2.5.5+ crashes on quit with chat rooms open

I've attached two patches. One for 2.5.5 (untested. I'll build a tree and confirm it works tomorrow) that reverts (someone should check) the problems I introduced in 8c4498cf31a819963d4ee74d433f2ed267d65b51. This is the one distros shipping 2.5.5 (*looks at Ubuntu*) will want to apply

The second (for 2.6.0 and the next release) introduces a new API that unloads plugins of a specific type. Regular plugins are unloaded before everything is uninit and then all plugins (prpls and loaders) are destroyed further below. This patch also moves the UI quit op back to where it should go (that change was just wrong :/).

Changed 9 years ago by darkrain42

comment:13 Changed 9 years ago by darkrain42

Both patches work to resolve this crash.

comment:14 Changed 9 years ago by QuLogic

Ticket #8860 has been marked as a duplicate of this ticket.

comment:15 Changed 9 years ago by QuLogic

Now, I may not be correct, but I think there could be a problem here:

for (l = plugins; l; l = l->next) {
    PurplePlugin *plugin = l->data;
    if (plugin->info->type == type && purple_plugin_is_loaded(plugin))
        purple_plugin_unload(plugin);
}

You have l, then you unload that plugin. Now one of two things should happen there (I haven't checked the unload function). In one case, the plugin is removed from the GList, and I assume l gets freed when that happens, so l->next might crash. In the other case, l is not removed from the GList, so you need to remove it or it'll get unloaded twice.

comment:16 Changed 9 years ago by darkrain42

plugins is the list of all plugins and purple_plugin_unload doesn't remove the plugin from that list. If I were using loaded_plugins or calling purple_plugin_destroy, those bad things could happen.

I opted to take the easy way out :)

comment:17 Changed 9 years ago by QuLogic

Oh, plugins and loaded_plugins. I noticed that, and totally didn't register it.

comment:18 Changed 9 years ago by qulogic@…

  • Resolution set to fixed
  • Status changed from new to closed

(In a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b):
Apply patch from darkrain42 to fix the crash-on-exit. Hopefully, the order of shutdown is no longer broken now.

Fixes #8774.

comment:19 Changed 9 years ago by QuLogic

Ticket #8982 has been marked as a duplicate of this ticket.

comment:20 Changed 9 years ago by QuLogic

Ticket #8995 has been marked as a duplicate of this ticket.

comment:21 Changed 9 years ago by QuLogic

Ticket #9017 has been marked as a duplicate of this ticket.

comment:22 Changed 9 years ago by QuLogic

Ticket #9050 has been marked as a duplicate of this ticket.

comment:23 Changed 9 years ago by darkrain42

Ticket #9071 has been marked as a duplicate of this ticket.

comment:24 Changed 9 years ago by darkrain42

  • Milestone changed from 2.6.0 to 2.5.6

comment:25 Changed 8 years ago by QuLogic

Ticket #8843 has been marked as a duplicate of this ticket.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!