Closed
Bug 445177
Opened 16 years ago
Closed 16 years ago
Crash [@ nsContentUtils::ComparePosition(nsINode*, nsINode*) ] with multipe identic ids
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: arno, Assigned: smaug)
References
Details
(Keywords: fixed1.9.1, regression, verified1.9.0.12, Whiteboard: [sg:dos] null deref, but maybe scary during mutation?)
Attachments
(4 files, 3 obsolete files)
864 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
3.98 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
3.97 KB,
patch
|
Details | Diff | Splinter Review | |
4.88 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
samuel.sidler+old
:
approval1.9.0.12+
|
Details | Diff | Splinter Review |
splitted from bug #442227 comment #8
Reporter | ||
Comment 1•16 years ago
|
||
From what I understand, (at least part of) problem lies in id attributtes handling. When document is parsed, <code/> will observe for first <box> as it is document.getElementById("1") at that time. Then, when <code> is removed from document, RemoveBroadcastListenerFor will be called with second box as an argument, as it's document.getElementById("1") at that time. I don't known how to solve that problem.
Comment 2•16 years ago
|
||
Maybe related to bug 395671?
Assignee | ||
Comment 3•16 years ago
|
||
I think we may want to try to sync broadcasters asyncronously, or in EndUpdate.
Assignee: jag → Olli.Pettay
Assignee | ||
Comment 4•16 years ago
|
||
Attachment #337730 -
Flags: superreview?(neil)
Attachment #337730 -
Flags: review?(enndeakin)
Comment 5•16 years ago
|
||
Comment on attachment 337730 [details] [diff] [review]
delay until it is ok to synchronize
I don't know what EndUpdate does, maybe you should ask someone who does ;-)
Attachment #337730 -
Flags: superreview?(neil)
Assignee | ||
Updated•16 years ago
|
Attachment #337730 -
Flags: superreview?(bzbarsky)
Comment 6•16 years ago
|
||
So why does this patch fix the bug? Comment 1 doesn't sound like it would be fixed by the patch...
Assignee | ||
Comment 7•16 years ago
|
||
There are mutation events while we're in document update - things aren't in very
consistent state.
But true, I need to take care of ID attrs.
Assignee | ||
Updated•16 years ago
|
Attachment #337730 -
Flags: superreview?(bzbarsky)
Attachment #337730 -
Flags: review?(enndeakin)
Assignee | ||
Comment 8•16 years ago
|
||
Actually, in this particular testcase the patch should work just fine. But there are other possible problems which we should fix too.
Assignee | ||
Comment 9•16 years ago
|
||
The first patch (included in this one) is needed to fix the crash, but to
properly cut listener->broadcaster link when removing listener from document
we need to go through all the broadcasters - scripts may have used .addBroadcastListenerFor().
Currently we don't remove broadcasters from the map, but that should be ok,
since broadcasters are used just as a key in the hashmap.
(I think we could actually remove BroadcasterMapEntry::mBroadcaster)
Attachment #337730 -
Attachment is obsolete: true
Attachment #337899 -
Flags: review?(enndeakin)
Comment 10•16 years ago
|
||
Comment on attachment 337899 [details] [diff] [review]
+remove listener properly from map
Seems OK. Can the testcase be incorporated?
Attachment #337899 -
Flags: review?(enndeakin) → review+
Assignee | ||
Comment 11•16 years ago
|
||
Yes, I need to write some tests. And there is also the crashtest - but that can be checked in only after porting the fix to branches. (Although it is a null pointer crash, I think using mutation listeners one can do pretty evil things.)
Assignee | ||
Comment 12•16 years ago
|
||
Comment on attachment 337899 [details] [diff] [review]
+remove listener properly from map
Boris, what do you think about this version?
Attachment #337899 -
Flags: superreview?(bzbarsky)
Assignee | ||
Comment 13•16 years ago
|
||
Assignee | ||
Comment 14•16 years ago
|
||
The change to current behavior are tests 10 and 11
Assignee | ||
Comment 15•16 years ago
|
||
Still, if we want to be very conservative, the first patch is enough.
It would be great if someone defined broadcaster-listener behavior in the case
of dynamic changes.
Assignee | ||
Updated•16 years ago
|
Attachment #337730 -
Attachment is obsolete: false
Attachment #337730 -
Flags: superreview?(bzbarsky)
Attachment #337730 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 16•16 years ago
|
||
Comment on attachment 337730 [details] [diff] [review]
delay until it is ok to synchronize
This isn't obsolete after all. This is the crashfix! The other patch changes the behavior a bit more. So for 1.9.0.x this is better. And the more I think about this all, the more I like this one.
Comment 17•16 years ago
|
||
Comment on attachment 337730 [details] [diff] [review]
delay until it is ok to synchronize
Add a comment about why synchronizing in mid-update is bad, perhaps?
Attachment #337730 -
Flags: superreview?(bzbarsky)
Attachment #337730 -
Flags: superreview+
Attachment #337730 -
Flags: review?(bzbarsky)
Attachment #337730 -
Flags: review+
Comment 18•16 years ago
|
||
Comment on attachment 337899 [details] [diff] [review]
+remove listener properly from map
sr=bzbarsky, but watch out for performance regressions here...
Attachment #337899 -
Flags: superreview?(bzbarsky) → superreview+
Assignee | ||
Comment 19•16 years ago
|
||
Comment on attachment 337730 [details] [diff] [review]
delay until it is ok to synchronize
I pushed this patch. Should get some backing time before landing to 1.9.0. And fixing the handling of dynamic changes isn't security sensitive.
author Olli Pettay <Olli.Pettay@helsinki.fi>
Tue Sep 16 11:53:30 2008 +0300 (at Tue Sep 16 11:53:30 2008 +0300)
changeset 19296 30306c8bfa2f
parent 19295 519540dd7880
Assignee | ||
Updated•16 years ago
|
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 20•16 years ago
|
||
This particular testcase causes a null deref, but I'm with Olli in comment 11 being suspicious of crashes due to mutation events. I assume seven or eight months (!) is enough baking time?
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.12?
Flags: blocking1.9.0.11?
Updated•16 years ago
|
Flags: blocking1.9.0.11? → wanted1.9.1?
Whiteboard: [sg:dos] null deref, but maybe scary during mutation?
Updated•16 years ago
|
Updated•16 years ago
|
Keywords: regression
Assignee | ||
Comment 21•15 years ago
|
||
This should fix bug 472668, bug 468211, bug 445177.
What I'm not quite sure is about the nsINode flag. Is that ok for 1.9.0?
Attachment #382278 -
Flags: superreview?(bzbarsky)
Attachment #382278 -
Flags: review?(bzbarsky)
Comment 22•15 years ago
|
||
> + if (length) {
That can't possibly be 0, right?
For the flag... can we set it to 0x80000000? That should be pretty much guaranteed to be unused at the moment. The change as written will make code compiled against the old header see this flag when it expects the script type, I think.
Assignee | ||
Comment 23•15 years ago
|
||
Attachment #382278 -
Attachment is obsolete: true
Attachment #382578 -
Flags: superreview?(bzbarsky)
Attachment #382578 -
Flags: review?(bzbarsky)
Attachment #382278 -
Flags: superreview?(bzbarsky)
Attachment #382278 -
Flags: review?(bzbarsky)
Updated•15 years ago
|
Attachment #382578 -
Flags: superreview?(bzbarsky)
Attachment #382578 -
Flags: superreview+
Attachment #382578 -
Flags: review?(bzbarsky)
Attachment #382578 -
Flags: review+
Assignee | ||
Updated•15 years ago
|
Attachment #382578 -
Flags: approval1.9.0.12?
Updated•15 years ago
|
Attachment #382578 -
Flags: approval1.9.0.12? → approval1.9.0.12+
Comment 24•15 years ago
|
||
Comment on attachment 382578 [details] [diff] [review]
v2 for 190
Approved for 1.9.0.12, a=dveditz for release-drivers
Assignee | ||
Comment 25•15 years ago
|
||
Checking in content/base/public/nsINode.h;
/cvsroot/mozilla/content/base/public/nsINode.h,v <-- nsINode.h
new revision: 3.78; previous revision: 3.77
done
Checking in content/xul/document/src/nsXULDocument.cpp;
/cvsroot/mozilla/content/xul/document/src/nsXULDocument.cpp,v <-- nsXULDocument.cpp
new revision: 1.833; previous revision: 1.832
done
Checking in content/xul/document/src/nsXULDocument.h;
/cvsroot/mozilla/content/xul/document/src/nsXULDocument.h,v <-- nsXULDocument.h
new revision: 1.210; previous revision: 1.209
done
Keywords: fixed1.9.0.12
Assignee | ||
Comment 27•15 years ago
|
||
Argh, trunk has the "delay until it is ok to synchronize",
not "+remove listener properly from map".
New patch for 190 coming.
Assignee | ||
Comment 28•15 years ago
|
||
I should have read comment 16.
Assignee | ||
Updated•15 years ago
|
Attachment #337899 -
Attachment is obsolete: true
Assignee | ||
Comment 29•15 years ago
|
||
No need for the nsINode flag.
Attachment #382578 -
Attachment is obsolete: true
Attachment #383180 -
Flags: superreview?(bzbarsky)
Attachment #383180 -
Flags: review?(bzbarsky)
Attachment #383180 -
Flags: approval1.9.0.12?
Updated•15 years ago
|
Attachment #383180 -
Flags: superreview?(bzbarsky)
Attachment #383180 -
Flags: superreview+
Attachment #383180 -
Flags: review?(bzbarsky)
Attachment #383180 -
Flags: review+
Comment 30•15 years ago
|
||
Comment on attachment 383180 [details] [diff] [review]
strict subset of the previous patch
I sort of trust you that this fixes the crash bug; I'm lost in all the patch variants here.
Assignee | ||
Comment 31•15 years ago
|
||
The patch is basically the same that landed on trunk + script runner changes also landed on trunk, like https://bugzilla.mozilla.org/attachment.cgi?id=358815&action=edit
Updated•15 years ago
|
Attachment #382578 -
Flags: approval1.9.0.12+
Updated•15 years ago
|
Attachment #383180 -
Flags: approval1.9.0.12? → approval1.9.0.12+
Comment 32•15 years ago
|
||
Comment on attachment 383180 [details] [diff] [review]
strict subset of the previous patch
Approved for 1.9.0.12. a=ss
Assignee | ||
Comment 33•15 years ago
|
||
Checking in content/xul/document/src/nsXULDocument.cpp;
/cvsroot/mozilla/content/xul/document/src/nsXULDocument.cpp,v <-- nsXULDocument.cpp
new revision: 1.835; previous revision: 1.834
done
Checking in content/xul/document/src/nsXULDocument.h;
/cvsroot/mozilla/content/xul/document/src/nsXULDocument.h,v <-- nsXULDocument.h
new revision: 1.212; previous revision: 1.211
done
Keywords: fixed1.9.0.12
Comment 34•15 years ago
|
||
Verified fixed in 1.9.0.12 with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.12pre) Gecko/2009063005 GranParadiso/3.0.12pre (.NET CLR 3.5.30729) using attached testcase. 1.9.0.11 crashes on same system.
Keywords: fixed1.9.0.12 → verified1.9.0.12
Updated•15 years ago
|
Keywords: fixed1.9.1
Updated•15 years ago
|
Group: core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•