Closed Bug 1304437 Opened 8 years ago Closed 8 years ago

Null-deref in ComputeMaskGeometry with mask image property

Categories

(Core :: Layout, defect, P1)

50 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla52
Tracking Status
firefox49 --- unaffected
firefox50 + verified
firefox51 + verified
firefox52 + verified

People

(Reporter: truber, Assigned: u459114)

References

(Blocks 1 open bug)

Details

(4 keywords, Whiteboard: [gfx-noted], tlt-wip)

Attachments

(5 files, 1 obsolete file)

Attached file testcase.html (deleted) —
Attached testcase crashes in mozilla-central revision 62f79d676e0e. No assertions hit in debug build. Stack: #0 0x7f9896e32234 in InvalidArrayIndex_CRASH(unsigned long, unsigned long) src/xpcom/glue/nsTArray.cpp:35:3 #1 0x7f989e42b6e0 in ElementAt src/obj-firefox/dist/include/nsTArray.h:1045:7 #2 0x7f989e42b6e0 in operator[] src/obj-firefox/dist/include/nsTArray.h:1074 #3 0x7f989e42b6e0 in operator[] src/layout/style/nsStyleStruct.h:540 #4 0x7f989e42b6e0 in ComputeMaskGeometry src/layout/svg/nsSVGIntegrationUtils.cpp:461 #5 0x7f989e42b6e0 in GenerateMaskSurface src/layout/svg/nsSVGIntegrationUtils.cpp:522 #6 0x7f989e42b6e0 in nsSVGIntegrationUtils::PaintMaskAndClipPath(nsSVGIntegrationUtils::PaintFramesParams const&) src/layout/svg/nsSVGIntegrationUtils.cpp:858 #7 0x7f989de78995 in nsDisplayMask::PaintAsLayer(nsDisplayListBuilder*, nsRenderingContext*, mozilla::layers::LayerManager*) src/layout/base/nsDisplayList.cpp:6912:5 #8 0x7f989dcce2f6 in PaintInactiveLayer src/layout/base/FrameLayerBuilder.cpp:3593:5 #9 0x7f989dcce2f6 in mozilla::FrameLayerBuilder::PaintItems(nsTArray<mozilla::FrameLayerBuilder::ClippedDisplayItem>&, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, gfxContext*, nsRenderingContext*, nsDisplayListBuilder*, nsPresContext*, mozilla::gfx::IntPointTyped<mozilla::gfx::UnknownUnits> const&, float, float, int) src/layout/base/FrameLayerBuilder.cpp:5690
Attached file stacktrace (deleted) —
Flags: in-testsuite?
Blocks: 1272859
Has STR: --- → yes
Component: Graphics: Layers → Layout
Keywords: regression
Whiteboard: [gfx-noted]
Flags: needinfo?(cku)
Assignee: nobody → cku
Flags: needinfo?(cku)
Blocks: mask-ship
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: [gfx-noted] → [gfx-noted], tlt-wip
Regression of Bug 1235494
[Tracking Requested - why for this release]:
[Tracking Requested - why for this release]:
Attachment #8793706 - Flags: review?(cam)
Attachment #8793707 - Flags: review?(cam)
Comment on attachment 8793706 [details] Bug 1304437 - Part 1. Return nsChangeHint_UpdateEffects when the length of the mask-image property has changed. https://reviewboard.mozilla.org/r/80400/#review79314 In the commit message: > Adapt nsChangeHint_UpdateEffects when the number of mask-image property changed. This sounds to me like we are changing the behaviour of UpdateEffects, instead of just choosing to return it. Something like this might be better: "Return nsChangeHint_UpdateEffects when the length of the mask-image property has changed." r=me with this and the change below. ::: layout/style/nsStyleStruct.cpp:2460 (Diff revision 2) > + if (mImageCount != aNewLayers.mImageCount) { > + hint |= nsChangeHint_UpdateEffects; > + } We don't need to add UpdateEffects if this nsStyleImageLayers is for background. Can we do something similar to aPositionChangeHint here? Maybe it makes more sense to pass in a single argument that says whether it's for background or mask, and then we determine what position change hint to use and whether to add UpdateEffects based on that. Same in nsStyleImageLayers::Layer::CalcDifference.
Attachment #8793706 - Flags: review?(cam) → review+
Attachment #8793707 - Flags: review?(cam) → review+
Pushed by cku@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0705576ca28c Part 1. Return nsChangeHint_UpdateEffects when the length of the mask-image property has changed. r=heycam https://hg.mozilla.org/integration/autoland/rev/d7582e076435 Part 2. Crash test. r=heycam
Tracking 52/51+.
Attached patch Patch for beta (obsolete) (deleted) — Splinter Review
Attached patch Patch for beta (deleted) — Splinter Review
Attachment #8794693 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment on attachment 8793706 [details] Bug 1304437 - Part 1. Return nsChangeHint_UpdateEffects when the length of the mask-image property has changed. Approval Request Comment [Feature/regressing bug #]: Bug 1235494 [User impact if declined]: Application crash by removing mask layers from mask-image. [Describe test coverage new/current, TreeHerder]: manual + try [Risks and why]: low. [String/UUID change made/needed]: Only part 1 is required. Aurora uses the same patch as central. I attached another patch for beta. Try result on beta: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b15d0af930c5 Try result on autora: https://treeherder.mozilla.org/#/jobs?repo=try&revision=a449397bd28d&selectedJob=28028598
Attachment #8793706 - Flags: approval-mozilla-beta?
Attachment #8793706 - Flags: approval-mozilla-aurora?
Comment on attachment 8793706 [details] Bug 1304437 - Part 1. Return nsChangeHint_UpdateEffects when the length of the mask-image property has changed. Fixes a reproducible crash, Aurora51+, Beta50+
Attachment #8793706 - Flags: approval-mozilla-beta?
Attachment #8793706 - Flags: approval-mozilla-beta+
Attachment #8793706 - Flags: approval-mozilla-aurora?
Attachment #8793706 - Flags: approval-mozilla-aurora+
beta patch landed in https://hg.mozilla.org/releases/mozilla-beta/rev/d1baa416e1b9 do you want also the crashtest uplifted ?
Flags: needinfo?(cku)
(In reply to Carsten Book [:Tomcat] from comment #25) > beta patch landed in > https://hg.mozilla.org/releases/mozilla-beta/rev/d1baa416e1b9 > > do you want also the crashtest uplifted ? No. Only functional correction patch(part 1) is required. Thanks
Flags: needinfo?(cku)
Flags: qe-verify+
I've managed to reproduce the crash using the testcase.html from comment 0. This issue is verified fixed on Firefox 50.0b9 (2016-10-20), latest Aurora 51.0a2 (2016-10-21) and latest Nightly 52.0a1 (2016-10-21) under the following OSes; - Windows 10 x64 - Ubuntu 16.04 x64 - Mac OS X 10.11.6 Marking here accordingly.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
Severity: normal → critical
Version: unspecified → 50 Branch
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: