Closed Bug 771749 Opened 13 years ago Closed 13 years ago

Crash [@ nsEditor::RemoveContainer]

Categories

(Core :: DOM: Editor, defect)

16 Branch
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla16
Tracking Status
firefox15 --- unaffected
firefox16 + fixed

People

(Reporter: jruderman, Assigned: ayg)

References

Details

(Keywords: crash, regression, testcase)

Crash Data

Attachments

(3 files)

Probably a regression in 4b1249ae1906:6d7fae9764b3
Attached file stack trace (gdb)
Crash Signature: [@ nsEditor::RemoveContainer]
This is a regression from bug 756750: - nsCOMPtr<nsIDOMNode> child; - while (bHasMoreChildren) - { - inNode->GetLastChild(getter_AddRefs(child)); - res = DeleteNode(child); - NS_ENSURE_SUCCESS(res, res); - res = InsertNode(child, parent, offset); + while (aNode->HasChildren()) { + nsIContent* child = aNode->GetLastChild(); + nsresult rv = DeleteNode(child->AsDOMNode()); + NS_ENSURE_SUCCESS(rv, rv); + + rv = InsertNode(child->AsDOMNode(), parent->AsDOMNode(), offset); If you assign a node to nsIContent* and then remove it from its parent, it is not wise to try to dereference the pointer afterwards.
Assignee: nobody → ayg
Blocks: 756750
Status: NEW → ASSIGNED
Keywords: regression
OS: Mac OS X → All
Hardware: x86_64 → All
Version: Trunk → 16 Branch
Attachment #640047 - Flags: review?(ehsan) → review+
Flags: in-testsuite+
Target Milestone: --- → mozilla16
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
(In reply to Jesse Ruderman from comment #0) > Created attachment 639918 [details] > testcase (requires focus) > > Probably a regression in 4b1249ae1906:6d7fae9764b3 Not able to reproduce on nightly 2012-07-06. Any ideas ?
Try a debug or ASan build? It's a pointer lifetime bug (causing a use-after-free) so it's not guaranteed to crash, especially in nightly builds.
Already tried the debug build and no success. I can't find older ASan builds, could you please point me to them?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: