Closed Bug 377892 Opened 18 years ago Closed 18 years ago

Simple clipPath asserting and crashing

Categories

(Core :: SVG, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: tor, Assigned: longsonr)

References

()

Details

Attachments

(4 files, 2 obsolete files)

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...)
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?
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.
This a debug build, no optimization.
Attached patch patch (obsolete) — Splinter Review
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.
Attached patch 2nd try (obsolete) — Splinter Review
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.
Attached patch working fixSplinter Review
Attached patch 3rd trySplinter Review
Attachment #261975 - Attachment is obsolete: true
Attachment #261975 - Flags: superreview?(tor)
Attachment #261975 - Flags: review?(tor)
Attachment #261977 - Flags: superreview?(tor)
Attachment #261977 - Flags: review?(tor)
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+
can you check in a reftest for this?
Flags: in-testsuite?
patch checked in. Will look into a reftest. I assume anything that uses a clipPath is OK.
Blocks: 377015
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
(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
Attached patch reftestSplinter Review
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 → ---
Why not just: <rect width="100%" height="100%" fill="lime"/> <rect width="100%" height="100%" fill="red" clip-path="url(#clipPath)"/>
mean't to leave it as fixed.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
Attachment #262247 - Flags: review?(jwatt)
reftest checked in. No svg reftests are automatically run though as far as I can tell.
Robert, did you miss my question in comment 17?
I changed the reftest as per your suggestion. Sorry for not making that clear.
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.
s/from a certain file/from a certain bug/
Attachment #262632 - Flags: review?(jwatt)
Flags: in-testsuite? → in-testsuite+
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+
I'll change it to clipPath on check in.
reftest changes checked in.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: