Closed
Bug 1180225
Opened 9 years ago
Closed 9 years ago
skia::ConvolveHorizontally_SSE2 leaks uninitialised pixel values
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: jseward, Assigned: jrmuizel)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(3 files, 2 obsolete files)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
seth
:
review+
|
Details | Diff | Splinter Review |
These eventually re-surface at mozilla::image::imgFrame::Optimize()
as (presumably) the generated image(s) are checked to see if they
are all one colour.
Reporter | ||
Comment 1•9 years ago
|
||
Generated on x86_64-linux, when loading
http://tangerine-tycoon.wikia.com/wiki/Tangerine_Tycoon_Wiki
Reporter | ||
Comment 2•9 years ago
|
||
A bit of digging shows this happens when the filter_length is not
divisible by 4, that is, this bit
int r = filter_length & 3;
if (r) {
memcpy(&buffer, row_to_filter, r * 4);
Problem is that |buffer| contains 4 elements, all of which make it
to imgFrame::Optimize() (presumably), but the memcpy doesn't initialise
all of them.
Reporter | ||
Comment 3•9 years ago
|
||
This zeroes out the otherwise-uninitialised 1, 2 or 3 vector elements
in |buffer|.
It looks as if ConvolveVertically_SSE2_impl, further down, has the same
problem, so this patch fixes that too.
Reporter | ||
Updated•9 years ago
|
Attachment #8629881 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 4•9 years ago
|
||
So this was introduced by bug 1054510 making changes to the upstream code that I wasn't aware of. I'm going to investigate whether we should just do what upstream is doing instead.
Reporter | ||
Comment 5•9 years ago
|
||
Jeff, is there any progress on this? Anything I can do to help move it along?
Assignee | ||
Comment 6•9 years ago
|
||
I tried switching to something closer to upstream and ran into some address sanitizer problems.
I've attached the WIP patch
Assignee | ||
Comment 7•9 years ago
|
||
It looks like there might be a bug in the upstream that's causing this. I'll continue to investigate.
Assignee | ||
Comment 8•9 years ago
|
||
Giving the convolver some extra room helps things.
Attachment #8637852 -
Attachment is obsolete: true
Assignee | ||
Comment 9•9 years ago
|
||
It's still broken:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=daf9a8f6b357
Assignee | ||
Comment 10•9 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #9)
> It's still broken:
> https://treeherder.mozilla.org/#/jobs?repo=try&revision=daf9a8f6b357
Wrong patch.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=3d21c9de8f24 will hopefully work better.
Assignee | ||
Comment 11•9 years ago
|
||
This worked better:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=61c7a54aaca6
Assignee | ||
Updated•9 years ago
|
Attachment #8629881 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 12•9 years ago
|
||
This adds 15 bytes of padding to the rows so that we don't have to worry about reading past the bounds and allows us to use a version of the convolver that's much closer to upstream.
Seth you're welcome to review the whole change but I'm mostly interested in the Downscaler.cpp changes.
Attachment #8646628 -
Attachment is obsolete: true
Attachment #8650588 -
Flags: review?(seth)
Reporter | ||
Comment 13•9 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #12)
> Created attachment 8650588 [details] [diff] [review]
> Make convolver more like upstream
From my point of view, looks good. I can no longer reproduce the V complaint
with this in place.
Comment 14•9 years ago
|
||
Comment on attachment 8650588 [details] [diff] [review]
Make convolver more like upstream
Review of attachment 8650588 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good. (I didn't look closely at the convolver code changes; presumably taking us closer to upstream is also taking us in the direction of correctness.)
It'd be good to test locally on a page with scaled JPEGs (imgur.com is good for this), just to sanity check that there's no obvious bustage. For now we only have a very small number of tests that run with HQ scaling enabled, and when HQ scaling is disabled we also don't use DDD. I'd like to eventually turn on DDD for all tests, but additional work is needed to avoid the kinds of races that HQ scaling is subject to.
Attachment #8650588 -
Flags: review?(seth) → review+
Comment 15•9 years ago
|
||
Comment 16•9 years ago
|
||
Assignee: nobody → jmuizelaar
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in
before you can comment on or make changes to this bug.
Description
•