Closed
Bug 771749
Opened 13 years ago
Closed 13 years ago
Crash [@ nsEditor::RemoveContainer]
Categories
(Core :: DOM: Editor, defect)
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
Reporter | ||
Comment 1•13 years ago
|
||
Updated•13 years ago
|
Crash Signature: [@ nsEditor::RemoveContainer]
Assignee | ||
Comment 2•13 years ago
|
||
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
Assignee | ||
Comment 3•13 years ago
|
||
Attachment #640047 -
Flags: review?(ehsan)
Updated•13 years ago
|
Updated•13 years ago
|
Attachment #640047 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 4•13 years ago
|
||
Flags: in-testsuite+
Target Milestone: --- → mozilla16
Comment 5•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
status-firefox16:
affected → ---
Updated•13 years ago
|
status-firefox16:
--- → fixed
tracking-firefox16:
--- → +
Comment 6•12 years ago
|
||
(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 ?
Reporter | ||
Comment 7•12 years ago
|
||
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.
Comment 8•12 years ago
|
||
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.
Description
•