Closed
Bug 377892
Opened 18 years ago
Closed 18 years ago
Simple clipPath asserting and crashing
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: tor, Assigned: longsonr)
References
()
Details
Attachments
(4 files, 2 obsolete files)
2.09 KB,
patch
|
Details | Diff | Splinter Review | |
1.88 KB,
patch
|
tor
:
review+
tor
:
superreview+
|
Details | Diff | Splinter Review |
1.40 KB,
patch
|
Details | Diff | Splinter Review | |
1.94 KB,
patch
|
jwatt
:
review+
|
Details | Diff | Splinter Review |
Simple w3c test without a reference loop gives these asserts and crashes:
###!!! ASSERTION: reference loop!: 'mFrame->mInUse == PR_FALSE', file /home/tor/moz/trunk/mozilla/layout/svg/base/src/nsSVGClipPathFrame.h, line 91
###!!! ASSERTION: reference loop!: 'mFrame->mInUse == PR_FALSE', file /home/tor/moz/trunk/mozilla/layout/svg/base/src/nsSVGClipPathFrame.h, line 91
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1076413328 (LWP 12393)]
0x41115b85 in nsSVGClipPathFrame::ClipPaint (this=0x0, aContext=0xbf8a82ec, aParent=0xa4c83d0, aMatrix=0xa4d20e8) at /home/tor/moz/trunk/mozilla/layout/svg/base/src/nsSVGClipPathFrame.cpp:112
112 if (mInUse) {
(gdb) where 10
#0 0x41115b85 in nsSVGClipPathFrame::ClipPaint (this=0x0, aContext=0xbf8a82ec, aParent=0xa4c83d0, aMatrix=0xa4d20e8) at /home/tor/moz/trunk/mozilla/layout/svg/base/src/nsSVGClipPathFrame.cpp:112
#1 0x4113d9df in nsSVGUtils::PaintChildWithEffects (aContext=0xbf8a82ec, aDirtyRect=0xbf8a82f8, aFrame=0xa4c839c) at /home/tor/moz/trunk/mozilla/layout/svg/base/src/nsSVGUtils.cpp:952
#2 0x41117020 in nsSVGDisplayContainerFrame::PaintSVG (this=0xa4c8000, aContext=0xbf8a82ec, aDirtyRect=0xbf8a82f8) at /home/tor/moz/trunk/mozilla/layout/svg/base/src/nsSVGContainerFrame.cpp:184
#3 0x4113da65 in nsSVGUtils::PaintChildWithEffects (aContext=0xbf8a82ec, aDirtyRect=0xbf8a82f8, aFrame=0xa4c8000) at /home/tor/moz/trunk/mozilla/layout/svg/base/src/nsSVGUtils.cpp:964
#4 0x4112c753 in nsSVGOuterSVGFrame::Paint (this=0xa4c6324, aRenderingContext=@0x42681dbc, aDirtyRect=@0xbf8a83d4, aPt=@0xbf8a8360)
at /home/tor/moz/trunk/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp:485
#5 0x4112c7de in nsDisplaySVG::Paint (this=0x426729e0, aBuilder=0xbf8a84d4, aCtx=0x42681dbc, aDirtyRect=@0xbf8a83d4) at /home/tor/moz/trunk/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp:376
#6 0x40ae8bdb in nsDisplayList::Paint (this=0x42672a1c, aBuilder=0xbf8a84d4, aCtx=0x42681dbc, aDirtyRect=@0xbf8a83d4) at /home/tor/moz/trunk/mozilla/layout/base/nsDisplayList.cpp:299
#7 0x40ae8e4d in nsDisplayWrapList::Paint (this=0x42672a10, aBuilder=0xbf8a84d4, aCtx=0x42681dbc, aDirtyRect=@0xbf8a83d4) at /home/tor/moz/trunk/mozilla/layout/base/nsDisplayList.cpp:707
#8 0x40ae9d0e in nsDisplayClip::Paint (this=0x42672a10, aBuilder=0xbf8a84d4, aCtx=0x42681dbc, aDirtyRect=@0xbf8a8454) at /home/tor/moz/trunk/mozilla/layout/base/nsDisplayList.cpp:939
#9 0x40ae8bdb in nsDisplayList::Paint (this=0x42672af4, aBuilder=0xbf8a84d4, aCtx=0x42681dbc, aDirtyRect=@0xbf8a8454) at /home/tor/moz/trunk/mozilla/layout/base/nsDisplayList.cpp:299
(More stack frames follow...)
Assignee | ||
Comment 1•18 years ago
|
||
Works for me on Windows XP, no asserts, no crash.
112 if (mInUse) {
113 NS_WARNING("Clip loop detected!");
114 return NS_OK;
115 }
116 AutoClipPathReferencer clipRef(this);
Line 112 *should* prevent the assert on line 116 from ever being triggered unless the compiler has somehow created the AutoClipPathReferencer object before the if test.
I'm not sure from the traceback how line 112 leads to the assert which is effectively coming from line 116. Are you compiling with optimisation and does it make any difference if you don't?
Assignee | ||
Comment 2•18 years ago
|
||
Perhaps it is more significant that ClipPaint has a this pointer of 0x00?
It appears as though mInUse is now uninitialized before AutoClipPathReferencer examines it for the first time.
Assignee | ||
Comment 5•18 years ago
|
||
Does this fix it for you?
Attachment #261971 -
Flags: superreview?(tor)
Attachment #261971 -
Flags: review?(tor)
(In reply to comment #5)
> Created an attachment (id=261971) [details]
> Does this fix it for you?
No - still asserts and crashes.
Backing out bug 377015 fixes this bug.
Assignee | ||
Comment 8•18 years ago
|
||
Attachment #261971 -
Attachment is obsolete: true
Attachment #261975 -
Flags: superreview?(tor)
Attachment #261975 -
Flags: review?(tor)
Attachment #261971 -
Flags: superreview?(tor)
Attachment #261971 -
Flags: review?(tor)
You might want to set AutoClipPathReferencer's mFrame to something.
Reporter | ||
Comment 10•18 years ago
|
||
Assignee | ||
Comment 11•18 years ago
|
||
Attachment #261975 -
Attachment is obsolete: true
Attachment #261975 -
Flags: superreview?(tor)
Attachment #261975 -
Flags: review?(tor)
Assignee | ||
Updated•18 years ago
|
Attachment #261977 -
Flags: superreview?(tor)
Attachment #261977 -
Flags: review?(tor)
Assignee | ||
Comment 12•18 years ago
|
||
I guess we're finally on the same wavelength.(In reply to comment #9)
> You might want to set AutoClipPathReferencer's mFrame to something.
>
Doh. Mea Culpa.
Attachment #261977 -
Flags: superreview?(tor)
Attachment #261977 -
Flags: superreview+
Attachment #261977 -
Flags: review?(tor)
Attachment #261977 -
Flags: review+
Assignee | ||
Comment 14•18 years ago
|
||
patch checked in. Will look into a reftest. I assume anything that uses a clipPath is OK.
Comment 15•18 years ago
|
||
(In reply to comment #14)
> patch checked in. Will look into a reftest. I assume anything that uses a
> clipPath is OK.
>
That's right.
http://developer.mozilla.org/en/docs/Creating_reftest-based_unit_tests
Assignee | ||
Comment 16•18 years ago
|
||
don't think I need a review for this do I? As it's my first attempt though...
Assignee: general → longsonr
Status: RESOLVED → ASSIGNED
Attachment #262247 -
Flags: review?(jwatt)
Resolution: FIXED → ---
Comment 17•18 years ago
|
||
Why not just:
<rect width="100%" height="100%" fill="lime"/>
<rect width="100%" height="100%" fill="red" clip-path="url(#clipPath)"/>
Assignee | ||
Comment 18•18 years ago
|
||
mean't to leave it as fixed.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•18 years ago
|
Attachment #262247 -
Flags: review?(jwatt)
Assignee | ||
Comment 19•18 years ago
|
||
reftest checked in. No svg reftests are automatically run though as far as I can tell.
Comment 20•18 years ago
|
||
Robert, did you miss my question in comment 17?
Assignee | ||
Comment 21•18 years ago
|
||
I changed the reftest as per your suggestion. Sorry for not making that clear.
Comment 22•18 years ago
|
||
Oh, and I was waiting for an answer to my question (to check I hadn't missed something obvious) before going on to suggest a couple of other things. ;-) My other suggestions would be:
* When a test comes from a certain file, please add a comment to the top of the source like the other reftests. I.e.
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=377892 -->
just after the <title> part. That way, wherever these tests go (W3C?) people can look up the history of them if they get failures or think the test may be invalid (sometimes things tested are subtle).
* Please use the -XX.svg suffix on file names, since as we go on we'll no doubt have many tests where it will make sense to give them the same basic file name as existing tests. I.e. in this case something like clipPath-basic-01.svg would be a good name I think.
Comment 23•18 years ago
|
||
s/from a certain file/from a certain bug/
Assignee | ||
Comment 24•18 years ago
|
||
Attachment #262632 -
Flags: review?(jwatt)
Updated•18 years ago
|
Flags: in-testsuite? → in-testsuite+
Comment 25•18 years ago
|
||
Comment on attachment 262632 [details] [diff] [review]
update per comments
yeah, looks good, although like the foreignObject file I did prefer clipPath... rather than clip-path... as the name. where ambiguity exists over whether the naming should be by tag or attribute, we could be consistent and go with tag. doesn't really matter though I guess.
Attachment #262632 -
Flags: review?(jwatt) → review+
Assignee | ||
Comment 26•18 years ago
|
||
I'll change it to clipPath on check in.
Comment 27•18 years ago
|
||
Cool. In that case reftest will be:
http://lxr.mozilla.org/seamonkey/source/layout/reftests/svg/clipPath-basic-01.svg
Assignee | ||
Comment 28•18 years ago
|
||
reftest changes checked in.
You need to log in
before you can comment on or make changes to this bug.
Description
•