Closed Bug 1219868 Opened 4 years ago Closed 4 years ago

49,200 instances of "NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005" emitted from layout/base/nsCSSFrameConstructor.cpp during linux64 debug testing

Categories

(Core :: SVG, defect, critical)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: erahm, Assigned: dholbert)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #325427 +++

This appears to be a regression from the testcase for bug 325427 landing.

> 49238 [NNNNN] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file layout/base/nsCSSFrameConstructor.cpp, line 4010

This warning [1] shows up in the following test suites:

> mozilla-central_ubuntu64_vm-debug_test-crashtest-e10s-bm116-tests1-linux64-build33.txt:24426
> mozilla-central_ubuntu64_vm-debug_test-crashtest-bm54-tests1-linux64-build36.txt:24426
> mozilla-central_ubuntu64_vm-debug_test-reftest-e10s-2-bm120-tests1-linux64-build24.txt:153
> mozilla-central_ubuntu64_vm-debug_test-reftest-3-bm117-tests1-linux64-build2.txt:121
> mozilla-central_ubuntu64_vm-debug_test-reftest-4-bm52-tests1-linux64-build1.txt:62
> mozilla-central_ubuntu64_vm-debug_test-reftest-e10s-1-bm121-tests1-linux64-build1.txt:13
> mozilla-central_ubuntu64_vm-debug_test-web-platform-tests-e10s-4-bm114-tests1-linux64-build4.txt:10
> mozilla-central_ubuntu64_vm-debug_test-web-platform-tests-4-bm68-tests1-linux64-build2.txt:10
> mozilla-central_ubuntu64_vm-debug_test-reftest-2-bm68-tests1-linux64-build1.txt:8
> mozilla-central_ubuntu64_vm-debug_test-reftest-1-bm52-tests1-linux64-build3.txt:4
> mozilla-central_ubuntu64_vm-debug_test-mochitest-3-bm115-tests1-linux64-build60.txt:2
> mozilla-central_ubuntu64_vm-debug_test-mochitest-e10s-5-bm113-tests1-linux64-build2.txt:1
> mozilla-central_ubuntu64_vm-debug_test-mochitest-e10s-3-bm68-tests1-linux64-build6.txt:1
> mozilla-central_ubuntu64_vm-debug_test-mochitest-5-bm125-tests1-linux64-build3.txt:1

It shows up in 99 tests. A few of the most prevalent:

> 48824 - file:///builds/slave/test/build/tests/reftest/tests/layout/svg/crashtests/325427-1.svg
> 42 - file:///builds/slave/test/build/tests/reftest/tests/layout/reftests/svg/image/image-preserveAspectRatio-04.svg
> 42 - file:///builds/slave/test/build/tests/reftest/tests/layout/reftests/svg/image/image-preserveAspectRatio-03.svg
> 40 - file:///builds/slave/test/build/tests/reftest/tests/layout/reftests/svg/image/image-preserveAspectRatio-02-raster.svg
> 40 - file:///builds/slave/test/build/tests/reftest/tests/layout/reftests/svg/image/image-preserveAspectRatio-01-raster.svg
> 30 - file:///builds/slave/test/build/tests/reftest/tests/layout/reftests/svg/use-01-extref.svg
> 8 - file:///builds/slave/test/build/tests/reftest/tests/layout/reftests/svg/use-02-extref.svg
> 6 - file:///builds/slave/test/build/tests/reftest/tests/layout/svg/crashtests/467498-1.svg
> 6 - file:///builds/slave/test/build/tests/reftest/tests/layout/reftests/svg/tspan-rotate-04.svg
> 6 - file:///builds/slave/test/build/tests/reftest/tests/layout/reftests/svg/tspan-rotate-02.svg

[1] https://hg.mozilla.org/mozilla-central/annotate/f7b746b4e913+/layout/base/nsCSSFrameConstructor.cpp#l4010
The hg.m.o source URL is broken (stray "+") -- corrected URL:
 https://hg.mozilla.org/mozilla-central/annotate/f7b746b4e913/layout/base/nsCSSFrameConstructor.cpp#l4010

Quoting the source, this is the NS_ENSURE_TRUE here:

> 4000 nsresult
> 4001 nsCSSFrameConstructor::GetAnonymousContent(nsIContent* aParent,
> 4002                                            nsIFrame* aParentFrame,
> 4003                                            nsTArray<nsIAnonymousContentCreator::ContentInfo>& aContent)
> 4004 {
> 4005   nsIAnonymousContentCreator* creator = do_QueryFrame(aParentFrame);
> 4006   if (!creator)
> 4007     return NS_OK;
> 4008 
> 4009   nsresult rv = creator->CreateAnonymousContent(aContent);
> 4010   NS_ENSURE_SUCCESS(rv, rv);
That CreateAnonymousContent line (4009) is returning NS_ERROR_FAILURE, due to failure in its call to SVGUseElement::CreateAnonymousContent() called on its local variable "use".

And SVGUseElement::CreateAnonymousContent() is failing due to its "circular loop detection", "check 2".  We're detecting a reference loop (correctly) and refusing to create anonymous content.

So, this seems like perhaps we shouldn't bother warning about (at least, not with NS_ENSURE_SUCCESS).
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #8680822 - Flags: review?(jwatt)
Attachment #8680822 - Attachment description: fix v1 → fix v1: use explicit early-return instead of spammy NS_ENSURE_SUCCESS
Following up on comment 2 -- here's a link to where the failure originates from:
https://mxr.mozilla.org/mozilla-central/source/dom/svg/SVGUseElement.cpp?rev=e8c7dfe727cd&mark=241-241,247-247,254-254#241

(It's line 254, which is a "return null" under "check 2", which is testing whether we're cloning something that is already in our clone hierarchy.)
And also for reference, the testcase that's spamming all these warnings is attachment 593788 [details] (recently checked in as "325427-1.svg" as noted in comment 0).
Comment on attachment 8680822 [details] [diff] [review]
fix v1: use explicit early-return instead of spammy NS_ENSURE_SUCCESS

Can you also add a comment noting this is one of the reasons the call might fail?
Attachment #8680822 - Flags: review?(jwatt) → review+
Will do.

(Just noticed this bug had slipped out of my scope; I'll circle back and land it, with that code-comment, later today.)
Flags: needinfo?(dholbert)
Added comment before landing:
 // CreateAnonymousContent failed, e.g. because the page has a <use> loop.
Flags: needinfo?(dholbert) → in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/f6469bd02e9d
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.