Closed
Bug 780908
Opened 13 years ago
Closed 12 years ago
Crash in nsHTMLEditor when forwarding email from PayPal occurs every time and in safe mode.
Categories
(Thunderbird :: Message Compose Window, defect)
Tracking
(firefox15-, thunderbird15 fixed, thunderbird16 fixed)
RESOLVED
FIXED
Thunderbird 17.0
People
(Reporter: 4miller, Assigned: rkent)
References
()
Details
(4 keywords, Whiteboard: [tbird topcrash][gs])
Crash Data
Attachments
(2 files, 1 obsolete file)
9.54 KB,
text/plain
|
Details | |
6.52 KB,
patch
|
ehsan.akhgari
:
review+
akeybl
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1
Steps to reproduce:
I opened email message from PayPal. I selected forward
Actual results:
Message window opened briefly then Thunderbird 15 crashed. Also crashed when trying again in safe mode
Expected results:
Message window should have opened for addressing
Comment 1•13 years ago
|
||
Larry, thanks for reporting this in getsatisfaction - at https://getsatisfaction.com/mozilla_messaging/topics/crash_when_forwarding_message
#1 crash for Thunderbird 15 beta.
bp-ff8ffaa9-93f0-4bb9-b820-c6d472120803 is one of Larry's.
Crash-stats comments hint this is highly reproducible when forwarding. And is a regression in version 15. I suggest this is needs to be fixed before shipping.
Severity: normal → critical
Status: UNCONFIRMED → NEW
Crash Signature: [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | nsAString_internal::Assign(nsAString_internal const&)]
tracking-firefox15:
--- → ?
Component: General → Editor
Ever confirmed: true
Summary: Crash when forwarding email from PayPal occurs every time and in safe mode. → Crash in nsHTMLEditor when forwarding email from PayPal occurs every time and in safe mode.
Whiteboard: [tbird topcrash][gs]
Comment 2•13 years ago
|
||
Mac and linux
bp-0c248379-d7e5-44e0-98d2-c30062120731
0 libmozalloc.dylib TouchBadMemory memory/mozalloc/mozalloc_abort.cpp:68
1 libmozalloc.dylib mozalloc_abort memory/mozalloc/mozalloc_abort.cpp:89
2 XUL NS_DebugBreak_P xpcom/base/nsDebugImpl.cpp:382
3 XUL nsAString_internal::Assign xpcom/string/src/nsTSubstring.cpp:348
4 XUL nsHTMLEditor::ReplaceHeadContentsWithHTML
5 XUL nsHTMLEditor::RebuildDocumentFromSource editor/libeditor/html/nsHTMLEditor.cpp:1523
6 XUL nsMsgCompose::ConvertAndLoadComposeWindow mailnews/compose/src/nsMsgCompose.cpp:711
7 XUL nsMsgCompose::BuildBodyMessageAndSignature mailnews/compose/src/nsMsgCompose.cpp:4499
8 XUL nsMsgCompose::InitEditor mailnews/compose/src/nsMsgCompose.cpp:1590
Crash Signature: [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | nsAString_internal::Assign(nsAString_internal const&)] → [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | nsAString_internal::Assign(nsAString_internal const&)]
[@ TouchBadMemory | mozalloc_abort | NS_DebugBreak_P | nsAString_internal::Assign]
OS: Windows 7 → All
Comment 3•13 years ago
|
||
The crash volume on this is not high enough to block Firefox release, un-tracking.
Comment 4•13 years ago
|
||
Can we get an example email that has this effect? That would make it much easier to debug
Keywords: testcase-wanted
Comment 5•13 years ago
|
||
Not a core bug, we're just being passed a bad string. Assigning to mconley to investigate.
Component: Editor → Message Compose Window
Keywords: testcase-wanted
Product: Core → Thunderbird
Version: 15 Branch → 15
Updated•13 years ago
|
Assignee: nobody → mconley
Keywords: testcase-wanted
Comment 6•13 years ago
|
||
Larry, can you attach a test message to the bug report with "Add an attachment"
(In reply to Wayne Mery (:wsmwk) from comment #6)
> Larry, can you attach a test message to the bug report with "Add an
> attachment"
messages came from PayPal with financial information and transaction ids, it has been deleted.
this is a similar message to the ones that would cause the crash when forwarding. Please protect any personal/banking information that may appear.
Assignee | ||
Updated•13 years ago
|
Attachment #650877 -
Attachment mime type: application/octet-stream → text/plain
Assignee | ||
Comment 9•13 years ago
|
||
I can verify a crash when I put this message into a local message folder, and tried to forward it. (Thunderbird Moz16 aurora build Windows 7).
Updated•13 years ago
|
Keywords: testcase-wanted → testcase
Assignee | ||
Comment 10•13 years ago
|
||
As I understand it, what is happening is that in nsHTMLEditor::RebuildDocumentFromSource we separately detect <head and <body then the crash occurs in this call:
res = ReplaceHeadContentsWithHTML(Substring(beginhead, beginbody));
The problem is that the html string begins like this:
<.H.T.M.L.>.<.B.O.D.Y.>
but later in that string we have the fragment:
<./.T.A.B.L.E.><.B.R.>.<.B.R.>.<.h.e.a.d. .t.i.t.l.e.=.".P.a.yP.a.l."./.>.<.b.o.d.y.>.
so beginhead is after beginbody, Substring(beginhead, beginbody) has a negative length, and when you to assign it to an nsAutoString the crash occurs.
Assignee | ||
Comment 11•13 years ago
|
||
This patch prevents the crash.
Comment 12•12 years ago
|
||
Comment on attachment 651015 [details] [diff] [review]
Rev1: check that head is before body
Review of attachment 651015 [details] [diff] [review]:
-----------------------------------------------------------------
This looks good overall, just one minor comment. Please move the condition check to after the existing statements, and in each case set the boolean to false if you detect an invalid head position.
Also, can you please write a test for this? The test should can be based on <http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/html/tests/test_bug607584.xul>. You can use that as a template, and just modify what appears on this line <http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/html/tests/test_bug607584.xul#62> and after it and call rebuildDocumentFromSource instead and pass in an HTML source string with the invalid head positions. Please ping me if you need help with writing the test.
Thanks!
Attachment #651015 -
Flags: review?(ehsan)
Comment 13•12 years ago
|
||
Comment on attachment 651015 [details] [diff] [review]
Rev1: check that head is before body
> nsReadingIterator<PRUnichar> beginhead;
> nsReadingIterator<PRUnichar> endhead;
> aSourceString.BeginReading(beginhead);
> aSourceString.EndReading(endhead);
>- bool foundhead = CaseInsensitiveFindInReadable(NS_LITERAL_STRING("<head"),
>- beginhead, endhead);
>+ bool foundhead = CaseInsensitiveFindInReadable(
>+ NS_LITERAL_STRING("<head"), beginhead, endhead) &&
>+ (!foundbody || beginhead.get() < beginbody.get());
Would it be better to set endhead to beginbody so that the find stops automatically? (Similarly for finding </head>.)
Comment 14•12 years ago
|
||
(In reply to comment #13)
> Comment on attachment 651015 [details] [diff] [review]
> --> https://bugzilla.mozilla.org/attachment.cgi?id=651015
> Rev1: check that head is before body
>
> > nsReadingIterator<PRUnichar> beginhead;
> > nsReadingIterator<PRUnichar> endhead;
> > aSourceString.BeginReading(beginhead);
> > aSourceString.EndReading(endhead);
> >- bool foundhead = CaseInsensitiveFindInReadable(NS_LITERAL_STRING("<head"),
> >- beginhead, endhead);
> >+ bool foundhead = CaseInsensitiveFindInReadable(
> >+ NS_LITERAL_STRING("<head"), beginhead, endhead) &&
> >+ (!foundbody || beginhead.get() < beginbody.get());
> Would it be better to set endhead to beginbody so that the find stops
> automatically? (Similarly for finding </head>.)
That would change the meaning of endhead... I think just modifying the boolean is going to be clearer.
Assignee | ||
Comment 15•12 years ago
|
||
Attachment #651015 -
Attachment is obsolete: true
Attachment #652520 -
Flags: review?(ehsan)
Comment 16•12 years ago
|
||
Comment on attachment 652520 [details] [diff] [review]
Rev2: add a test
Review of attachment 652520 [details] [diff] [review]:
-----------------------------------------------------------------
Looks great!
Attachment #652520 -
Flags: review?(ehsan) → review+
Updated•12 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 17•12 years ago
|
||
Comment on attachment 652520 [details] [diff] [review]
Rev2: add a test
Checked in https://hg.mozilla.org/integration/mozilla-inbound/rev/37f9c2c24931
Assignee | ||
Updated•12 years ago
|
Flags: in-testsuite+
Hardware: x86_64 → All
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 18•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 17.0
Comment 19•12 years ago
|
||
#2 crash so far for TB15, but perhaps it will drop.
Still, it was #1 crash for TB15.0b5, so I suspect we will want take this on aurora and beta so as to drive this into TB16, at a minimum. TB16 is affected bp-392b3f4f-3dce-4562-84d4-060322120823 TB16
Comment 20•12 years ago
|
||
Comment on attachment 652520 [details] [diff] [review]
Rev2: add a test
[Approval Request Comment]
Regression caused by (bug #): bug# wasn't identified
User impact if declined: users have trouble forwarding mail
Testing completed (on c-c, etc.): ~2 weeks clean
Risk to taking this patch (and alternatives if risky): no regressions filed so far. Perhaps rkent or others could better asses risk of the code changed
Attachment #652520 -
Flags: approval-comm-beta?
Attachment #652520 -
Flags: approval-comm-aurora?
Assignee | ||
Comment 21•12 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #20)
> Comment on attachment 652520 [details] [diff] [review]
> Rev2: add a test
>
> [Approval Request Comment]
> Regression caused by (bug #): bug# wasn't identified
> User impact if declined: users have trouble forwarding mail
> Testing completed (on c-c, etc.): ~2 weeks clean
> Risk to taking this patch (and alternatives if risky): no regressions filed
> so far. Perhaps rkent or others could better asses risk of the code changed
The small changes here all correct cases that otherwise would crash, so I would expect minimal risk.
Assignee | ||
Comment 22•12 years ago
|
||
Wayne, this is fixed in current aurora. Also, this is a core patch so it needs approval in core, not comm.
Updated•12 years ago
|
Crash Signature: [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | nsAString_internal::Assign(nsAString_internal const&)]
[@ TouchBadMemory | mozalloc_abort | NS_DebugBreak_P | nsAString_internal::Assign] → [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | nsAString_internal::Assign(nsAString_internal const&)]
[@ TouchBadMemory | mozalloc_abort | NS_DebugBreak_P | nsAString_internal::Assign]
[@ mozalloc_abort | NS_DebugBreak_P | nsAString_internal::…
Comment 23•12 years ago
|
||
Comment on attachment 652520 [details] [diff] [review]
Rev2: add a test
(In reply to Kent James (:rkent) from comment #22)
> Wayne, this is fixed in current aurora. Also, this is a core patch so it
> needs approval in core, not comm.
quite right. The fog is extra thick today
[Approval Request Comment]
ref comment 20 and comment 21
String or UUID changes made by this patch: none
Attachment #652520 -
Flags: approval-mozilla-beta?
Attachment #652520 -
Flags: approval-comm-beta?
Attachment #652520 -
Flags: approval-comm-aurora?
Comment 24•12 years ago
|
||
Comment on attachment 652520 [details] [diff] [review]
Rev2: add a test
This is a crash regression in TB15 - we'll take this on mozilla-beta in support of the next TB version.
Attachment #652520 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Assignee | ||
Comment 25•12 years ago
|
||
So what is the process to push this to mozilla-beta? Can I just do it, or does someone else need to make that happen?
Comment 26•12 years ago
|
||
You can do it.
Comment 27•12 years ago
|
||
If you don't have a beta checkout, or if you need help, please let me know and I will be happy to land it for you.
Assignee | ||
Comment 28•12 years ago
|
||
Comment on attachment 652520 [details] [diff] [review]
Rev2: add a test
Checked in https://hg.mozilla.org/releases/mozilla-beta/rev/c892527135cd
Assignee | ||
Updated•12 years ago
|
status-thunderbird16:
--- → fixed
Comment 29•12 years ago
|
||
I landed this on a Thunderbird specific relbranch for TB 15.0.1:
https://hg.mozilla.org/releases/mozilla-release/rev/a347058c607a
status-thunderbird15:
--- → fixed
Comment 30•12 years ago
|
||
(In reply to Mark Banner (:standard8) from comment #29)
> I landed this on a Thunderbird specific relbranch for TB 15.0.1:
>
> https://hg.mozilla.org/releases/mozilla-release/rev/a347058c607a
fwiw, SeaMonkey will piggyback on this relbranch for our 2.12.1
You need to log in
before you can comment on or make changes to this bug.
Description
•