Closed Bug 955365 Opened 11 years ago Closed 6 years ago

Crash [@ purpleAccountBuddy::Get* ] during shutdown

Categories

(Chat Core :: General, defect)

x86
Windows 7
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: clokep, Assigned: florian)

Details

Attachments

(2 files)

Attached file C++ Stack trace
*** Original post on bio 1928 as attmnt 2381 at 2013-04-18 00:24:00 UTC ***

JS Stack trace:
I think the JS stack is:
0 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/b
in/components/imContacts.js":1063]
    this = [object Object]
1 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/b
in/components/imContacts.js":707]
    this = [object Object]
2 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/b
in/components/imContacts.js":758]
    this = [object Object]
3 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/b
in/components/imContacts.js":840]
    this = [object Object]
4 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/b
in/components/imContacts.js":1093]
    this = [object Object]
5 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/b
in/components/imContacts.js":1099]
    this = [object Object]
6 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/b
in/components/imContacts.js":1060]
    this = [object Object]
7 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/b
in/components/imContacts.js":1061]
    this = [object Object]
8 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/b
in/components/imContacts.js":990]
    this = [object Object]
9 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/b
in/components/imContacts.js":1033]
    this = [object Object]
10 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debug/mozilla/dist/
bin/components/imContacts.js":1109]
    this = [object Object]
11 anonymous() ["resource:///modules/jsProtoHelper.jsm":221]
    this = [object Object]
12 anonymous() ["resource:///modules/jsProtoHelper.jsm":291]
    this = [object Object]
13 anonymous() ["resource:///modules/jsProtoHelper.jsm":292]
    this = [object Object]
14 anonymous() ["resource:///modules/xmpp.jsm":1185]
    this = [object Object]
15 anonymous() ["resource:///modules/xmpp.jsm":747]
    this = [object Object]
16 anonymous() ["file:///c:/Users/Patrick/instantbird/objdir-debu
*** Original post on bio 1928 at 2013-04-18 21:56:07 UTC ***

I've identified a possible cause for this shutdown mess. Filed it as a separate bug 955376 (bio 1938), as I'm not sure it's the only thing we want to fix for this crash.

Also note that this bug is very similar to bug 955289 (bio 1856).
*** Original post on bio 1928 at 2013-11-03 01:33:55 UTC ***

The stacks in comment 0 are in purpleAccountBuddy::GetDisplayName and purpleAccountBuddy::GetServerAlias. I reproduced today this shutdown crash in purpleAccountBuddy::GetCanSendMessage, I'm pretty sure it's the same root cause (our prupleAccountBuddy instance not uninitialized when libpurple's PurpleBuddy is freed during shutdown).

Here is the JS stack I got:
0 anonymous() ["components/imContacts.js":1109]
1 anonymous() ["components/imContacts.js":831]
2 anonymous() ["components/ibConvStatsService.js":658]
3 anonymous() ["components/ibConvStatsService.js":303]
4 anonymous() ["components/ibConvStatsService.js":293]
5 anonymous() ["components/ibConvStatsService.js":221]
6 anonymous() ["components/ibConvStatsService.js":523]
7 anonymous() ["components/imContacts.js":858]
8 anonymous() ["components/imContacts.js":861]
9 anonymous() ["components/imContacts.js":816]
10 anonymous() ["components/imContacts.js":817]

The problem there is that during shutdown, we uninitialize libpurple and then the contacts service, which fires plenty of notifications, which the stats service listens for some reason... and then the stats services pointlessly attempts to access plenty of stuff during shutdown, even though some may have already been freed.

There are different problems here:
1. The JS code doing nonsense shouldn't make the application crash. I'm going to address this purplexpcom issue here.
2. The contacts (and possibly conversations too) service shouldn't send update notifications during shutdown.
3. (maybe) The stats service should stop listening to notifications after receiving the prpl-quit notification.

I think 1. should be fixed ASAP (and I have a patch); 2. is worth considering but there's no rush: it's been like this for several releases before (we should definitely file a bug though!); for 3. I would like nhnt11's opinion, it may be wanted for 1.5 but it most likely doesn't block.
Summary: purplexpcom shutdown crash on Windows [@ msvcr100.dll@0x28ec ] → Crash [@ purpleAccountBuddy::Get* ] during shutdown
Attached patch PatchSplinter Review
*** Original post on bio 1928 as attmnt 3010 at 2013-11-03 01:34:00 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8354791 - Flags: review?(clokep)
Assignee: nobody → florian
Comment on attachment 8354791 [details] [diff] [review]
Patch

*** Original change on bio 1928 attmnt 3010 at 2013-11-03 13:42:05 UTC ***

It looks like this will fix the issue.
Attachment #8354791 - Flags: review?(clokep) → review+
*** Original post on bio 1928 at 2013-11-03 16:05:42 UTC ***

(In reply to comment #4)
> Created attachment 8354791 [details] [diff] [review] (bio-attmnt 3010) [details]
> Patch

http://hg.instantbird.org/instantbird/rev/5a529e019c69

Thanks.

I'll leave this open until we decide about 2 & 3.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: