Closed Bug 476467 Opened 12 years ago Closed 12 years ago

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

Categories

(MailNews Core :: Networking: SMTP, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b2

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch The fix (obsolete) — Splinter Review
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)
Attached patch The fix v2 (obsolete) — Splinter Review
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)
Attached patch The fix v2aSplinter Review
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)
Attachment #360301 - Flags: superreview?(bienvenu)
Attachment #360301 - Flags: superreview+
Attachment #360301 - Flags: review?(bienvenu)
Attachment #360301 - Flags: review+
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"
Patch checked in: http://hg.mozilla.org/comm-central/rev/6790fbe2b70f
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.