"###!!! ASSERTION: child count gone negative:" when sending unsent email

RESOLVED FIXED in Thunderbird 3.0b2

Status

RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: standard8, Assigned: standard8)

Tracking

unspecified
Thunderbird 3.0b2
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

10 years ago
Created attachment 360085 [details] [diff] [review]
The fix

If I compose a message and select to send it later, then I select to send unsent messages, I'm getting the assertion:

###!!! ASSERTION: child count gone negative: 'childCount != 0 || delta > 0', file /mozilla/master/main/mailnews/db/msgdb/src/nsMsgThread.cpp, line 1008

Analysis (thank you David) says that we're attempting to delete a message twice.

I've done some debugging and found various issues:

1) The send later service doesn't protect against double-deletions
- I've added in some protection and included an assertion so we can track other potential causes.

2) mail.really_delete_draft doesn't do what it says (it actually stops deletion of sent messages from the outbox if sending later)
- This is now dropped.

3) The nsMsgSend service was sending multiple OnStopSending notifications in various instances:
3a) When the MsgDeliverListener received the OnStopSending notification
- This is pointless because the following function call to SendDeliveryCallback calls OnStopSending to the listeners with extra information (e.g. message id).
3b) When its not doing an Fcc
- Again pointless; the Fcc operation is saying we're not copying a message via OnStopCopy because Fcc is all about copy. So for it to say its not sending as well is wrong especially as we've done that earlier before DoFcc got called.

Patch attached, the mail.really_delete_draft removal covers the 3a and 3b cases which were "hidden" before.
Attachment #360085 - Flags: superreview?(bienvenu)
Attachment #360085 - Flags: review?(bienvenu)
(Assignee)

Comment 1

10 years ago
Created attachment 360285 [details] [diff] [review]
The fix v2

I just remembered, now we have fixed the OnStopSending being called twice we can also check that the aSuccessful count is correct (previously it would have been double the amount sent).
Attachment #360085 - Attachment is obsolete: true
Attachment #360285 - Flags: superreview?(bienvenu)
Attachment #360285 - Flags: review?(bienvenu)
Attachment #360085 - Flags: superreview?(bienvenu)
Attachment #360085 - Flags: review?(bienvenu)
(Assignee)

Comment 2

10 years ago
Created attachment 360301 [details] [diff] [review]
The fix v2a

Apologies, minor bitrot update.
Attachment #360285 - Attachment is obsolete: true
Attachment #360301 - Flags: superreview?(bienvenu)
Attachment #360301 - Flags: review?(bienvenu)
Attachment #360285 - Flags: superreview?(bienvenu)
Attachment #360285 - Flags: review?(bienvenu)

Updated

10 years ago
Attachment #360301 - Flags: superreview?(bienvenu)
Attachment #360301 - Flags: superreview+
Attachment #360301 - Flags: review?(bienvenu)
Attachment #360301 - Flags: review+

Comment 3

10 years ago
Comment on attachment 360301 [details] [diff] [review]
The fix v2a

seems to work fine, and the tests work. One typo:

+    // Its the caller's responsibility to say we've stopped sending, so just

should be "It's" or "It is"
(Assignee)

Comment 4

10 years ago
Patch checked in: http://hg.mozilla.org/comm-central/rev/6790fbe2b70f
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
(Assignee)

Updated

10 years ago
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.