RESOLVED FIXED 63646
Crash in SVGUseElement::updateContainerOffsets on <use> with no parent
https://bugs.webkit.org/show_bug.cgi?id=63646
Summary Crash in SVGUseElement::updateContainerOffsets on <use> with no parent
Tim Horton
Reported 2011-06-29 12:23:45 PDT
Created attachment 99126 [details] test case The attached SVG crashes WebKit in SVGUseElement::updateContainerOffsets. In a debug build, we get an ASSERTion failure saying that the <use> element doesn't have a parentNode.
Attachments
test case (341 bytes, image/svg+xml)
2011-06-29 12:23 PDT, Tim Horton
no flags
Patch (3.18 KB, patch)
2011-07-04 14:48 PDT, Rob Buis
no flags
Patch (3.56 KB, patch)
2011-07-24 18:33 PDT, Rob Buis
darin: review+
Tim Horton
Comment 1 2011-06-29 12:24:15 PDT
Nikolas Zimmermann
Comment 2 2011-06-30 01:31:00 PDT
> Created an attachment (id=99126) [details] > test case > > The attached SVG crashes WebKit in SVGUseElement::updateContainerOffsets. Excellent catch. Tim, where have you been all the years? :-) Your work is highly appreciated. > > In a debug build, we get an ASSERTion failure saying that the <use> element doesn't have a parentNode. That's not correct, the <use> has a parentNode - it's shadow tree root element (living in the <use> renderer) lost its parent. Do you feel like debugging? :-)
Tim Horton
Comment 3 2011-06-30 10:10:48 PDT
(In reply to comment #2) > > Created an attachment (id=99126) [details] [details] > > test case > > > > The attached SVG crashes WebKit in SVGUseElement::updateContainerOffsets. > Excellent catch. Tim, where have you been all the years? :-) Your work is highly appreciated. > > > > > In a debug build, we get an ASSERTion failure saying that the <use> element doesn't have a parentNode. > That's not correct, the <use> has a parentNode - it's shadow tree root element (living in the <use> renderer) lost its parent. Alright, that makes a lot more sense. > Do you feel like debugging? :-) Now that you've explained it correctly, I think it'll be easier to figure it out, so sure! (I couldn't make my explanation make any sense given what was actually going on in the document, but I figured someone else would have some insight, and you did!)
Tim Horton
Comment 4 2011-06-30 17:19:46 PDT
Nope, I think this one is beyond me for now. It's clear that it's because we're unlinking the middle use in the chain from its child content, but I can't follow exactly where we diverge from the case where the first use in the chain (the last one in the file) doesn't exist. I don't know enough about the shadow tree and friends to track this one down yet. Feels like we're just failing to detachInstance() or something, but I'm not sure where.
Rob Buis
Comment 5 2011-07-04 14:48:56 PDT
Tim Horton
Comment 6 2011-07-05 09:55:19 PDT
(In reply to comment #5) > Created an attachment (id=99658) [details] > Patch Rob's patch is certainly sufficient to fix the symptom; should we at least take this for now and figure out the root cause later?
Nikolas Zimmermann
Comment 7 2011-07-05 11:06:28 PDT
(In reply to comment #6) > (In reply to comment #5) > > Created an attachment (id=99658) [details] [details] > > Patch > > Rob's patch is certainly sufficient to fix the symptom; should we at least take this for now and figure out the root cause later? Are we in hurry with a fix for this? If so yes, but I don't think so. We should rather find out if the null parentNode is "okay", or not. Rob?
Rob Buis
Comment 8 2011-07-24 18:33:03 PDT
Rob Buis
Comment 9 2011-07-24 18:34:04 PDT
Hi Niko, (In reply to comment #7) > (In reply to comment #6) > > (In reply to comment #5) > > > Created an attachment (id=99658) [details] [details] [details] > > > Patch > > > > Rob's patch is certainly sufficient to fix the symptom; should we at least take this for now and figure out the root cause later? > > Are we in hurry with a fix for this? If so yes, but I don't think so. We should rather find out if the null parentNode is "okay", or not. Rob? I uploaded a new patch, hopefully this fix is better and the ChangeLog should explain the problem. Cheers, Rob.
Rob Buis
Comment 10 2011-07-24 19:17:41 PDT
Landed in r91653.
Note You need to log in before you can comment on or make changes to this bug.