Bug 173804

Summary: REGRESSION (AsyncImageDecoding): A tab with the WWDC keynote paused is killed for using excessive power (Image thrashing)
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: ImagesAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cdumez, commit-queue, ggaren, kling, rniwa, sabouhallawa, simon.fraser
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
simon.fraser: review+
patch
none
patch
none
patch
buildbot: commit-queue-
Archive of layout-test-results from ews103 for mac-elcapitan
none
Archive of layout-test-results from ews116 for mac-elcapitan
none
patch none

Description Antti Koivisto 2017-06-23 21:08:54 PDT
Easy repro in trunk: 
1) https://www.apple.com/apple-events/june-2017/
2) notifyutil -p org.WebKit.lowMemory.begin
Comment 1 Antti Koivisto 2017-06-23 21:09:12 PDT
<rdar://problem/32623745>
Comment 2 Antti Koivisto 2017-06-26 16:43:16 PDT
Created attachment 313874 [details]
patch
Comment 3 Simon Fraser (smfr) 2017-06-26 16:51:04 PDT
Comment on attachment 313874 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=313874&action=review

> Source/WebCore/platform/graphics/BitmapImage.cpp:229
> +                imageObserver()->didDraw(*this);

It's confusing, and not very future-proof, to call something called 'didDraw' when we didn't actually draw.

> LayoutTests/fast/images/low-memory-decode.html:15
> +    }, 100);

This will always take 100ms. Consider using shouldBecomeTrue().
Comment 4 Antti Koivisto 2017-06-26 16:52:27 PDT
> It's confusing, and not very future-proof, to call something called
> 'didDraw' when we didn't actually draw.

Actually I'll get rid of this for the patch. It is not needed to fix the bug.
 
> > LayoutTests/fast/images/low-memory-decode.html:15
> > +    }, 100);
> 
> This will always take 100ms. Consider using shouldBecomeTrue().
Comment 5 Antti Koivisto 2017-06-26 16:58:19 PDT
Created attachment 313875 [details]
patch
Comment 6 Antti Koivisto 2017-06-26 16:59:24 PDT
> > > LayoutTests/fast/images/low-memory-decode.html:15
> > > +    }, 100);
> > 
> > This will always take 100ms. Consider using shouldBecomeTrue().

That doesn't work because it would make the test succeed even without code changes.
Comment 7 Simon Fraser (smfr) 2017-06-26 17:01:04 PDT
Comment on attachment 313875 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=313875&action=review

> LayoutTests/fast/images/low-memory-decode.html:15
> +    }, 200);

Maybe you can bail if you see > 1 decode.
Comment 8 Antti Koivisto 2017-06-26 17:11:13 PDT
Created attachment 313876 [details]
patch
Comment 9 Antti Koivisto 2017-06-26 17:24:35 PDT
Created attachment 313877 [details]
patch
Comment 10 Build Bot 2017-06-26 17:59:26 PDT
Comment on attachment 313877 [details]
patch

Attachment 313877 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/4003307

New failing tests:
fast/images/low-memory-decode.html
Comment 11 Build Bot 2017-06-26 17:59:27 PDT
Created attachment 313881 [details]
Archive of layout-test-results from ews103 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 12 Build Bot 2017-06-26 18:45:44 PDT
Comment on attachment 313877 [details]
patch

Attachment 313877 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/4003402

New failing tests:
fast/images/low-memory-decode.html
Comment 13 Build Bot 2017-06-26 18:45:46 PDT
Created attachment 313884 [details]
Archive of layout-test-results from ews116 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 14 Antti Koivisto 2017-06-26 19:05:56 PDT
Created attachment 313885 [details]
patch
Comment 15 WebKit Commit Bot 2017-06-26 20:28:04 PDT
Comment on attachment 313885 [details]
patch

Clearing flags on attachment: 313885

Committed r218826: <http://trac.webkit.org/changeset/218826>
Comment 16 WebKit Commit Bot 2017-06-26 20:28:06 PDT
All reviewed patches have been landed.  Closing bug.