Closed Bug 19371 Opened 25 years ago Closed 25 years ago

[DOGFOOD][REGRESSION] entering text and hitting return in new message crashes app

Categories

(MailNews Core :: Composition, defect, P3)

x86
Windows 95
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: rubydoo123, Assigned: kinmoz)

Details

using build 1999111808 on win95
1. launch seamonkey
2. select Tasks | Mail
3. in mail, select New from toolbar
4. set focus in the mail compose body, enter several characters, then press
enter.

RESULT: app crashes, will paste talkback report shortly
Summary: entering text and hitting return in new message crashes app → [DOGFOOD] entering text and hitting return in new message crashes app
adding dogfood.
html compose, beth?
talkback incident # 1048197

Call Stack:    (Signature = nsHTMLEditRules::IsLastNode cfa7a21c)

nsHTMLEditRules::IsLastNode
[d:\builds\seamonkey\mozilla\editor\base\nsHTMLEditRules.cpp, line 2047]

nsHTMLEditRules::GetPromotedPoint
[d:\builds\seamonkey\mozilla\editor\base\nsHTMLEditRules.cpp, line 2231]

nsHTMLEditRules::GetPromotedRanges
[d:\builds\seamonkey\mozilla\editor\base\nsHTMLEditRules.cpp, line 2291]

nsHTMLEditRules::CleanUpSelection
[d:\builds\seamonkey\mozilla\editor\base\nsHTMLEditRules.cpp, line 3356]

nsHTMLEditRules::DidDoAction
[d:\builds\seamonkey\mozilla\editor\base\nsHTMLEditRules.cpp, line 149]

nsHTMLEditor::InsertBreak
[d:\builds\seamonkey\mozilla\editor\base\nsHTMLEditor.cpp, line 1493]

nsHTMLEditorLog::InsertBreak
[d:\builds\seamonkey\mozilla\editor\base\nsHTMLEditorLog.cpp, line 215]

nsHTMLEditor::TypedText
[d:\builds\seamonkey\mozilla\editor\base\nsHTMLEditor.cpp, line 686]

nsHTMLEditorLog::TypedText
[d:\builds\seamonkey\mozilla\editor\base\nsHTMLEditorLog.cpp, line 181]

nsHTMLEditor::EditorKeyPress
[d:\builds\seamonkey\mozilla\editor\base\nsHTMLEditor.cpp, line 664]

nsTextEditorKeyListener::KeyPress
[d:\builds\seamonkey\mozilla\editor\base\nsEditorEventListeners.cpp, line 206]

nsEventListenerManager::HandleEvent
[d:\builds\seamonkey\mozilla\layout\events\src\nsEventListenerManager.cpp, line
798]

nsDocument::HandleDOMEvent
[d:\builds\seamonkey\mozilla\layout\base\src\nsDocument.cpp, line 2381]

nsHTMLHtmlElement::HandleDOMEvent
[d:\builds\seamonkey\mozilla\layout\html\content\src\nsHTMLHtmlElement.cpp, line
193]

nsGenericDOMDataNode::HandleDOMEvent
[d:\builds\seamonkey\mozilla\layout\base\src\nsGenericDOMDataNode.cpp, line 801]

nsXMLCDATASection::HandleDOMEvent
[d:\builds\seamonkey\mozilla\layout\xml\content\src\nsXMLCDATASection.cpp, line
214]

PresShell::HandleEvent
[d:\builds\seamonkey\mozilla\layout\html\base\src\nsPresShell.cpp, line 2411]

nsView::HandleEvent
[d:\builds\seamonkey\mozilla\view\src\nsView.cpp, line 840]

nsView::HandleEvent
[d:\builds\seamonkey\mozilla\view\src\nsView.cpp, line 825]

nsView::HandleEvent
[d:\builds\seamonkey\mozilla\view\src\nsView.cpp, line 825]

nsView::HandleEvent
[d:\builds\seamonkey\mozilla\view\src\nsView.cpp, line 825]

nsViewManager::DispatchEvent
[d:\builds\seamonkey\mozilla\view\src\nsViewManager.cpp, line 1724]

HandleEvent
[d:\builds\seamonkey\mozilla\view\src\nsView.cpp, line 69]

nsWindow::DispatchEvent
[d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 441]

nsWindow::DispatchWindowEvent
[d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 458]

nsWindow::DispatchKeyEvent
[d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 2161]

nsWindow::OnChar
[d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 2469]

nsWindow::ProcessMessage
[d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 2612]

nsWindow::WindowProc
[d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 625]

KERNEL32.DLL + 0x3663 (0xbff73663)
KERNEL32.DLL + 0x22894 (0xbff92894)
0x00638c38
Kin's been tracking this down as follows:

Okay, here's the problem. The mail compose initial document looks like this:

<html><head></head>
<body></body>

</html>

It should look like this:

<html><head></head>
<body>

<br moz_editor_bogus_node="TRUE">
</body>

</html>

I'm currently looking for the code that inserts the bogus node into about:blank
documents.
Assignee: ducarroz → buster
I reassign this bug to buster for investigation as apparently is a ender matter.
Summary: [DOGFOOD] entering text and hitting return in new message crashes app → [DOGFOOD][REGRESSION] entering text and hitting return in new message crashes app
Similar to the bug bienvenu filed?
http://bugzilla.mozilla.org/show_bug.cgi?id=19349
Assignee: buster → kin
Target Milestone: M12
reassign to kin for now
Okay, I think I've figured out what's going on.

nsMsgCompose::ConvertAndLoadComposeWindow()  is calling
aEditorShell->InsertSource() with a zero length string which is
blowing away our bogus node.

I think 2 things need to happen:

1. MailNews shouldn't call InsertSource() if there is no source to insert.
2. The editor should protect itself against bogus inserts.

Here's the fix on the MailNews side of things:

Index: nsMsgCompose.cpp
===================================================================
RCS file: /cvsroot/mozilla/mailnews/compose/src/nsMsgCompose.cpp,v
retrieving revision 1.110
diff -r1.110 nsMsgCompose.cpp
197c197,198
<       aEditorShell->InsertSource(aBuf.GetUnicode());
---
>       if (aBuf != "")
>         aEditorShell->InsertSource(aBuf.GetUnicode());
203c204,205
<       aEditorShell->InsertText(aBuf.GetUnicode());
---
>       if (aBuf != "")
>         aEditorShell->InsertText(aBuf.GetUnicode());
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fix checked into mozilla/mailnews/compose/src/nsMsgCompose.cpp revision 1.111.
r=sfraser@netscape.com, a=leaf@mozilla.org
Kin, thanks for tracking this down.
QA Contact: lchiang → nbaca
Ninoschka - can you help to verify this? Thanks.
Status: RESOLVED → VERIFIED
Build 1999112208M12: NT4
Verified Fixed. Also checked Linux and Mac and they do not crash after hitting
return in the mail compose body.
Blocks: 20203
No longer blocks: 20203
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.