Closed Bug 350252 Opened 18 years ago Closed 18 years ago

Attribute change causes use clone loop

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: jayden, Unassigned)

References

Details

(Keywords: hang, regression, testcase)

Attachments

(5 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060825 Minefield/3.0a1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060825 Minefield/3.0a1 While working on a test case for MineField I came across this bug. Attached is an svg page that will crash MineField. Please don't view with MineField unless you are prepared to have your browser crash. This does not affect Firefox 1.5. Reproducible: Always I tested and this bug does not occur if I use a rect directly and not through a use/defs.
Attachment #235496 - Attachment description: SVG page that shows the crash → SVG page that crashes MineField. Save page so you can see the source or use Firefox 1.5 to view.
Summary: Setting background color through DOM for an SVG rect defined in defs using a use crashes → Setting background color through DOM for an SVG rect defined in defs using a use hangs browser
With Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20060825 Minefield/3.0a1 the testcase hangs my firefox (not crash, so I don't get a talkbackid) Works fine with Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1b2) Gecko/20060825 BonEcho/2.0b2 ID:2006082504
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: hang, testcase
(In reply to comment #2) > With Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20060825 > Minefield/3.0a1 the testcase hangs my firefox (not crash, so I don't get a > talkbackid) > > Works fine with Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1b2) > Gecko/20060825 BonEcho/2.0b2 ID:2006082504 > If you kill the application while it is hung you do have windows send an error report. I have sent a few of these already, before I posted this bug. I'm not sure how microsoft gets these bugs to the right people but hopefully they have sent something which can be helpful. When I mentioned crash I should have been more specific and mention that if you had something in another window it would be gone. If you have chatzilla up while your browser gets hung chatzilla also be hung. On my system as well when hung the process uses exactly 50% of my CPU which seems a little strange. I have an AMD Athlon 64 X2 Dual Core Processor 4400+ (2.2 Ghz) - It isn't using 1 CPU at max it is using both.
http://developer.mozilla.org/en/docs/How_to_get_a_stacktrace_with_WinDbg please use the mcsmurf build to get a stack. i certainly don't have access to microsoft's feedback system.
(In reply to comment #4) > http://developer.mozilla.org/en/docs/How_to_get_a_stacktrace_with_WinDbg > > please use the mcsmurf build to get a stack. i certainly don't have access to > microsoft's feedback system. > I'll do this when I get home from work and post an attachment of what I get.
Summary: Setting background color through DOM for an SVG rect defined in defs using a use hangs browser → Attribute change at window load event causes use clone loop
Attached image minimal testcase
Regressed in the past month or so - help tracking down the regression window would be appreciated. Testcase that was used for bug 343900 development now loops.
Keywords: regression
Summary: Attribute change at window load event causes use clone loop → Attribute change causes use clone loop
(In reply to comment #8) > Created an attachment (id=235756) [edit] > testcase without load - click on rect > The issue I was having happened when you set the "backgroundColor" of the rect not the "fill". I tried setting the fill and don't remember having a problem with that it was when I tried the backgroundColor (which of course shouldn't work) that I had problems. I don't have MineField here at work so I don't know if your tests also crash MineField or not. I'll check them out as well when I get home in just under 6 hours.
Looking through the checkins in the regression window, bug 348573 seems like a likely cause, though the followup patch waiting for review doesn't fix the problem in this case.
Backing out bug 348573 fixes this.
Depends on: 348573
So the problem is that nsSVGUseElement::AttributeChanged removes and readds the nsSVGUseElement as an observer on mSourceContent. I don't know why it does this, but this isn't going to work given that the listener array is now iterated forwards. A simple test shows that the problem existed for the ContentInserted notification even before the patch for bug 348573. Just replace the line: element.setAttribute("fill", "red"); with: el2 = document.createElement("rect"); element.setAttribute("fill", "red"); and try a build from August 14. The basic problem was introduced in bug 343900, of course. Now as I see it, there are two ways forward. Either we document on nsINode to Not Do This with nsIMutationObservers and fix the SVG code accordingly, or document that newly-added observers will not get called (subject to some conditions, etc) and actually do that (probably by keeping track of the "original length" adjusted for removals in the iterator). Sicking, thoughts?
Blocks: 343900, 348573
No longer depends on: 348573
Flags: blocking1.9?
Attachment #236143 - Flags: review?(bugmail)
Comment on attachment 236143 [details] [diff] [review] check if we're looking at the same element to avoid looping r/sr=sicking
Attachment #236143 - Flags: superreview+
Attachment #236143 - Flags: review?(bugmail)
Attachment #236143 - Flags: review+
If this comes up again I think we should consider making the nsTObserverArray iterator hold a position and an end and adjust both of them when an element is removed.
OK. We should still document the current behavior, though, right?
Checked in.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Attachment #245730 - Flags: superreview?(bugmail)
Attachment #245730 - Flags: review?(bugmail)
Attachment #245730 - Flags: superreview?(bugmail)
Attachment #245730 - Flags: superreview+
Attachment #245730 - Flags: review?(bugmail)
Attachment #245730 - Flags: review+
Checked in the comments.
Flags: blocking1.9?
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: