Closed
Bug 1462742
Opened 7 years ago
Closed 6 years ago
Crash in AssertUniqueItem on devices with touch screens
Categories
(Core :: Web Painting, defect)
Tracking
()
VERIFIED
FIXED
mozilla62
Tracking | Status | |
---|---|---|
firefox-esr52 | --- | unaffected |
firefox-esr60 | --- | unaffected |
firefox60 | --- | unaffected |
firefox61 | + | fixed |
firefox62 | + | fixed |
People
(Reporter: calixte, Assigned: mstange)
References
(Blocks 2 open bugs)
Details
(Keywords: crash, regression)
Crash Data
Attachments
(1 file)
59 bytes,
text/x-review-board-request
|
emilio
:
review+
RyanVM
:
approval-mozilla-beta+
|
Details |
This bug was filed from the Socorro interface and is
report bp-ad6efb82-a644-4f3b-908d-06ae10180518.
=============================================================
Top 10 frames of crashing thread:
0 xul.dll AssertUniqueItem layout/painting/nsDisplayList.cpp:141
1 xul.dll mozilla::SVGGeometryFrame::BuildDisplayList layout/svg/SVGGeometryFrame.cpp:262
2 xul.dll nsIFrame::BuildDisplayListForChild layout/generic/nsFrame.cpp:3821
3 xul.dll nsContainerFrame::BuildDisplayListForNonBlockChildren layout/generic/nsContainerFrame.cpp:389
4 xul.dll nsSVGDisplayContainerFrame::BuildDisplayList layout/svg/nsSVGContainerFrame.cpp:154
5 xul.dll nsIFrame::BuildDisplayListForStackingContext layout/generic/nsFrame.cpp:3082
6 xul.dll nsIFrame::BuildDisplayListForChild layout/generic/nsFrame.cpp:3759
7 xul.dll nsContainerFrame::BuildDisplayListForNonBlockChildren layout/generic/nsContainerFrame.cpp:389
8 xul.dll nsSVGDisplayContainerFrame::BuildDisplayList layout/svg/nsSVGContainerFrame.cpp:154
9 xul.dll nsIFrame::BuildDisplayListForChild layout/generic/nsFrame.cpp:3821
=============================================================
There is 1 crash in nightly 62 with buildid 20180518100150. In analyzing the backtrace, the regression may have been introduced by patch [1] to fix bug 1459997.
[1] https://hg.mozilla.org/mozilla-central/rev?node=488b7be0348b
Flags: needinfo?(matt.woodrow)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → mstange
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•7 years ago
|
||
Bwinton is able to reliably reproduce this crash when using the devtools inspector to inspect an SVG document. As soon as he hovers the inspector's DOM tree (which attempts to show a highlighter), the content process crashes.
I cannot reproduce this crash by doing that. The highlighters never show for me on SVG documents, and the existence of bug 1157592 seems to indicate that this is expected. So I don't know why things are different for bwinton.
Brad, since you have worked on bug 1157592 before, do you know how it could happen that we build the display list items for the canvas anonymous content? Do you know if it's possible that we visit the same frame twice during display list construction? Some of the comments in that bug say that we sometimes put the frame for the anonymous content in the wrong place in the frame tree. Is it possible that display list building traverses the frame tree during normal child list traversal once, and then again when building the display list for the "top layer" in https://searchfox.org/mozilla-central/rev/eb51d734a8c06ac5973291be9bcc74ed4e999bca/layout/generic/ViewportFrame.cpp#187 ?
Flags: needinfo?(bwerth)
Updated•7 years ago
|
Comment 4•7 years ago
|
||
Yup. Did someone do something that they think fixed it, or were you just double-checking? ;)
Flags: needinfo?(bwinton)
Comment 5•6 years ago
|
||
We determined that in order for this crash to be reproduced, the device must have a touch screen.
Summary: Crash in AssertUniqueItem → Crash in AssertUniqueItem on devices with touch screens
Assignee | ||
Comment 6•6 years ago
|
||
Alternatively, you can set the pref layout.accessiblecaret.enabled to true in order to reproduce the crash.
The accessible caret causes us to always create anonymous content for the canvas frame. So if we then want to insert the anonymous content for the highlighter, there's already anonymous content present, and bug 1157592 comment 4 comes in:
(In reply to Boris Zbarsky [:bz] from bug 1157592 comment #4)
> And incidentally, it's a bit weird that we construct the frame differently
> depending on whether we already have anonymous content when we're
> constructing the canvas or not. If we already have anonymous content when
> we construct the canvas, then we put the placeholder for the anon div as a
> child of the CanvasFrame directly. But if we add the anon content after the
> canvas has been constructed already, the placeholder ends up as a child of
> the document element's frame, because we take the normal content-insertion
> codepath.
Flags: needinfo?(matt.woodrow)
Flags: needinfo?(bwerth)
Updated•6 years ago
|
tracking-firefox61:
--- → +
tracking-firefox62:
--- → +
Comment hidden (mozreview-request) |
Assignee | ||
Comment 8•6 years ago
|
||
I found a workaround. I wrote a very confident comment but I'm not entirely sure everything in it is accurate.
Comment 9•6 years ago
|
||
mozreview-review |
Comment on attachment 8984591 [details]
Bug 1462742 - Don't build display items for the custom content container frame twice during the same paint.
https://reviewboard.mozilla.org/r/250464/#review256870
::: layout/generic/ViewportFrame.cpp:195
(Diff revision 1)
> + // list. That's a bug in the way we construct frames for the custom
> + // content container, to be fixed in bug 1157592.
> + // The ContainsFrame check is going to be cheap because the canvas
> + // frame usually only has a single principal child: the primary frame
> + // of the document's root element.
> + if (!canvasFrame->PrincipalChildList().ContainsFrame(frame)) {
So I took a deeper look at this and the underlying issue here is that this frame is not out of flow. The underlying reason for that is that the `-moz-top-layer: top` declaration in:
https://searchfox.org/mozilla-central/rev/e6a0a192ea8691f7eb466506301da73fabe8fd23/layout/style/res/ua.css#481
Which would force absolute position in:
https://searchfox.org/mozilla-central/rev/e6a0a192ea8691f7eb466506301da73fabe8fd23/servo/components/style/style_adjuster.rs#120
Is not getting applied (or is getting undone by something else).
I need to find why. This looks like an acceptable workaround (probably just checking `frame->StyleDisplay()->mTopLayer != NS_STYLE_TOP_LAYER_TOP` is the right condition here, pointing to that bug.
Mind if I try to figure out out why before stamping such thing?
Assignee | ||
Comment 10•6 years ago
|
||
Thanks for taking such a detailed look!
My goal was to try to fix this crash for Beta, which turns into RC on Monday after the all hands. I'm not sure if people are going to be available for approvals during the all hands, so it's possible that I've already missed my window. So I'm not sure which trade-off between "finding the right fix" and "stopping the crash quickly" we should be going for.
Comment 11•6 years ago
|
||
mozreview-review |
Comment on attachment 8984591 [details]
Bug 1462742 - Don't build display items for the custom content container frame twice during the same paint.
https://reviewboard.mozilla.org/r/250464/#review256880
Ok, let me write a patch that fixes the underlying issue and I think is upliftable. If we deem it not upliftable or not safe enough, we can just check `mTopLayer` there instead of `PrincipalChildList()`.
Attachment #8984591 -
Flags: review?(emilio)
Comment 12•6 years ago
|
||
mozreview-review |
Comment on attachment 8984591 [details]
Bug 1462742 - Don't build display items for the custom content container frame twice during the same paint.
https://reviewboard.mozilla.org/r/250464/#review256882
::: layout/generic/ViewportFrame.cpp:195
(Diff revision 1)
> + // list. That's a bug in the way we construct frames for the custom
> + // content container, to be fixed in bug 1157592.
> + // The ContainsFrame check is going to be cheap because the canvas
> + // frame usually only has a single principal child: the primary frame
> + // of the document's root element.
> + if (!canvasFrame->PrincipalChildList().ContainsFrame(frame)) {
Actually, if we plan to uplift, it's better to just land the check.
Please change this condition to:
```
if (frame->StyleDisplay()->mTopLayer != NS_STYLE_TOP_LAYER_TOP)
```
And mention in the comment that the root cause for this happening and bug 1157592 is because SVG documents don't load `ua.css` when we create the custom content container, which contains the rule that makes this a top layer frame.
r=me with that.
Attachment #8984591 -
Flags: review+
Comment 13•6 years ago
|
||
Err, comment 12 is supposed to say:
if (frame->StyleDisplay()->mTopLayer != NS_STYLE_TOP_LAYER_NONE)
Comment 14•6 years ago
|
||
Bug 1157592 contains the right fix now.
Comment 15•6 years ago
|
||
Is this good to land? Would be nice if we could get it landed in time for Thursday's b14 build if possible.
Flags: needinfo?(mstange)
Assignee | ||
Comment 16•6 years ago
|
||
I'm applying Emilio's comments at the moment and will land on autoland shortly afterwards.
Flags: needinfo?(mstange)
Comment hidden (mozreview-request) |
Comment 18•6 years ago
|
||
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/6bcd91f7f50a
Don't build display items for the custom content container frame twice during the same paint. r=emilio
Comment 19•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Comment 20•6 years ago
|
||
Verified that the crash is now gone in the latest Nightly.
Status: RESOLVED → VERIFIED
Assignee | ||
Comment 21•6 years ago
|
||
Comment on attachment 8984591 [details]
Bug 1462742 - Don't build display items for the custom content container frame twice during the same paint.
Approval Request Comment
[Feature/Bug causing the regression]: retained display lists
[User impact if declined]: crashes on devices with touch screens when using developer tools on SVG documents
[Is this code covered by automated tests?]: yes, but this specific interaction is not, and this patch doesn't add a crashtest
[Has the fix been verified in Nightly?]: yes
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]: none
[Is the change risky?]: no
[Why is the change risky/not risky?]: the bug is well-understood and the patch is very small
[String changes made/needed]: none
Attachment #8984591 -
Flags: approval-mozilla-beta?
Comment 22•6 years ago
|
||
Comment on attachment 8984591 [details]
Bug 1462742 - Don't build display items for the custom content container frame twice during the same paint.
Fixes a crash on touchscreen devices with RDL enabled. Approved for 61.0rc1.
Attachment #8984591 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 23•6 years ago
|
||
bugherder uplift |
You need to log in
before you can comment on or make changes to this bug.
Description
•