Closed Bug 345445 Opened 19 years ago Closed 18 years ago

"ASSERTION: index out of range" involving gradient (nsSVGValue::NotifyObservers)

Categories

(Core :: SVG, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: tor)

References

Details

(Keywords: assertion, testcase)

Attachments

(4 files)

This testcase causes: ###!!! ASSERTION: index out of range: '0 <= aIndex && aIndex < Count()', file /Users/admin/trunk/mozilla/xpcom/build/../glue/nsVoidArray.h, line 373 The assertion fires from nsSmallVoidArray::ElementAt, which also does run-time bounds checking.
Attached image testcase (deleted) —
Attached file stack trace (mac debug / gdb) (deleted) —
Attachment #230103 - Attachment mime type: application/xhtml+xml → image/svg+xml
Summary: "ASSERTION: index out of range" involving gradient → "ASSERTION: index out of range" involving gradient (nsSVGValue::NotifyObservers)
This was happening because a nsSVGGeometryFrame was adding itself as an observer of the gradient for both fill and stroke. Since two entries were added, the logic in NotifyObservers for teardown got itself twisted.
Assignee: general → tor
Status: NEW → ASSIGNED
Attachment #230148 - Flags: review?(roc)
Attachment #230148 - Flags: superreview?(roc)
Attachment #230148 - Flags: review?(roc)
Attachment #230148 - Flags: review+
If an element has both fill and stroke pointing at a given gradient, and then you remove one of those attributes (but leave the other), will the element continue to observe the gradient with this patch?
Yes, because on a style change we remove both, as the change notification isn't fine grained, and re-add as appropriate.
Comment on attachment 230148 [details] [diff] [review] prevent duplicate observers from being added Add the explanation in comment #5 as a comment
Attachment #230148 - Flags: superreview?(roc) → superreview+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Crashtest checked in.
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: