+++ This bug was initially created as a clone of Bug #1451137 +++ I just let a testing IMAP account sync messages and regularly get this TB crash: Assertion failure: strlen(fCurrentLine) == 1 && fCurrentLine == '\n' (Expect ' ' as only character in this line), at mailnews/imap/src/nsImapServerResponseParser.cpp:3209 I is supposed to be fixed in bug 1451137, but I still get it on TB trunk.
A few months ago I also saw this error on trunk. I have a fix for it stashed away but haven't revisited it yet or submitted a patch. I think it was caused by fetching a series of messages, each as a single chunk, and on one message the last line of the email was corrupted so that it ended in just \r and not \r\n. This caused the next email to be fetched to be assumed to have just a \n for the first line that triggers the assert. I will test this again, duplicate it and fix it.
Assignee: nobody → gds
I re-duplicated the problem I saw and tested the patch and it fixes the assert that I saw. If the assert still occurs after this patch applied, I will need more info such as the source for the email that causes the assert and other steps to causes the problem, if possible. The problem I was seeing was because the last line of the email stored on the server ended in just \r and not \r\n. So this was being treated as a split \r\n and I was expecting to see the \n as the first line of the next chunk. But this was last chunk of message A. When I looked at message B, the assert hit because I was expecting to see just \n but instead see a normal full line.
Comment on attachment 9019931 [details] [diff] [review] 1494764-ignore-corrupted-eol-on-last-line-of-last-chunk.patch Looks reasonable. I'll run the unit tests for you locally.
Attachment #9019931 - Flags: review?(jorgk) → review+
What's the functional problem mentioned in the commit comment? Does this need backport to TB 60.x?
The problem is that without the assert to cause a crash the next email opened after the one that ends with just \r fails to display. I didn't test that this time but I will to to be sure. Will let you know ASAP.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/comm-central/rev/7a29a83fb1ab Ignore missing \n on last line of last chunk. r=jorgk
Status: ASSIGNED → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → FIXED
Comment on attachment 9019931 [details] [diff] [review] 1494764-ignore-corrupted-eol-on-last-line-of-last-chunk.patch Review of attachment 9019931 [details] [diff] [review]: ----------------------------------------------------------------- Thanks. I have not seen the crash since this was landed. It may also happen the problem message is no longer on the server. I'll speak up if it happens again.
Attachment #9019931 - Flags: feedback?(acelists) → feedback+
Summary: MOZ_ASSERT(strlen(fCurrentLine) == 1 && fCurrentLine == '\n', "Expect '\n' as only character in this line") - triggered again → MOZ_ASSERT(strlen(fCurrentLine) == 1 && fCurrentLine == '\n', "Expect '\n' as only character in this line") - triggered again during last (or only) chunk
You need to log in before you can comment on or make changes to this bug.