Summary: | Safari crash on call to DOMImplementation.createDocumentType | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Curt Arnold <curt.arnold> | ||||||||
Component: | DOM | Assignee: | Anders Carlsson <andersca> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Major | ||||||||||
Priority: | P2 | ||||||||||
Version: | 412 | ||||||||||
Hardware: | Mac | ||||||||||
OS: | OS X 10.4 | ||||||||||
Attachments: |
|
Description
Curt Arnold
2005-06-22 14:26:36 PDT
Confirmed crash on build 412 and TOT (CVS TIP) as of 6/22/2005 8:00 PM CDT. Created attachment 2563 [details]
Test case [CRASH]
Created attachment 2627 [details]
Don't assume that nodes always have a document pointer.
The crash is due to the assumption that dom nodes always have a document
pointer. This isn't true for nodes created with createElementType, as they
haven't been associated with any document.
(I'm not sure if DOMNode::Mark() needs to be fixed aswell)
Comment on attachment 2627 [details]
Don't assume that nodes always have a document pointer.
I'm not sure about the patch -- if these document type nodes aren't attached to
any document, perhaps there will be a lifetime issue for the wrappers? Maybe
you'll get two different wrappers for the same document type node, so that if
you attached a property to it early on and later got it once it was attached to
a document the property would be gone.
Comment on attachment 2627 [details]
Don't assume that nodes always have a document pointer.
Yes, DOMNode::mark() also needs to be updated to handle this case. If there's
no document, it should just take the early return that calls DOMObject::mark().
And DOMNode::getValueProperty needs an update too.
I'm thinking that patching each and every place that calls getDocument could be
a losing battle -- we might need to change the way document type nodes are
created to at least point them at a DocumentPtr that is 0 rather than having
the DocumentPtr itself be 0. There could be a single "always-0" DocumentPtr for
use in cases like that.
Once we do that we could revisit the things patched here -- we wouldn't have to
patch anything that checks the result of getDocument() for 0, only the things
that assume it's non-0.
Created attachment 2872 [details]
Add always-0 documentptr
Here's a new patch which adds a nullDocumentPtr().
Comment on attachment 2872 [details]
Add always-0 documentptr
r=me
|