Bug 161259

Summary: REGRESSION (r204987): fast/canvas-composite-* tests are now flaky assertion failures
Product: WebKit Reporter: Ryan Haddad <ryanhaddad>
Component: New BugsAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, cdumez, commit-queue, esprehn+autocc, gyuyoung.kim, joepeck, kling
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Ryan Haddad 2016-08-26 12:39:55 PDT
fast/canvas-composite-* tests are now flaky assertion failures

Seems to have started with https://trac.webkit.org/changeset/204987

Seen with:
fast/canvas/canvas-composite-text-alpha.html
fast/canvas/canvas-composite-stroke-alpha.html
fast/canvas/canvas-composite-transformclip.html
fast/canvas/canvas-composite.html
fast/canvas/canvas-composite-canvas.html

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=fast%2Fcanvas%2Fcanvas-composite

ASSERTION FAILED: externalMemorySize() <= extraMemorySize()
/Volumes/Data/slave/elcapitan-debug/build/Source/JavaScriptCore/heap/Heap.cpp(1447) : void JSC::Heap::didFinishCollection(double)
1   0x107231430 WTFCrash
2   0x106ac1fd2 JSC::Heap::didFinishCollection(double)
3   0x106ac11a2 JSC::Heap::collectImpl(JSC::HeapOperation, void*, void*, int (&) [37])
4   0x106ac0aed JSC::Heap::collect(JSC::HeapOperation)
5   0x106a9f16b JSC::FullGCActivityCallback::doCollection()
6   0x106ab0db0 JSC::GCActivityCallback::doWork()
7   0x106adb34e JSC::HeapTimer::timerDidFire(__CFRunLoopTimer*, void*)
8   0x7fff8f40ab94 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
9   0x7fff8f40a823 __CFRunLoopDoTimer
10  0x7fff8f40a37a __CFRunLoopDoTimers
11  0x7fff8f401871 __CFRunLoopRun
12  0x7fff8f400ed8 CFRunLoopRunSpecific
13  0x7fff90d49935 RunCurrentEventLoopInMode
14  0x7fff90d4976f ReceiveNextEventCommon
15  0x7fff90d495af _BlockUntilNextEventMatchingListInModeWithFilter
16  0x7fff95c11df6 _DPSNextEvent
17  0x7fff95c11226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
18  0x7fff95c05d80 -[NSApplication run]
19  0x7fff95bcf368 NSApplicationMain
20  0x7fff9a697194 _xpc_objc_main
21  0x7fff9a695bbe xpc_main
22  0x102993080 main
23  0x7fff87f615ad start
LEAK: 23 WebProcessPool
LEAK: 23 WebPageProxy
Comment 1 Ryan Haddad 2016-08-26 12:40:35 PDT
See also: <rdar://problem/27219483>
Comment 2 Andreas Kling 2016-08-26 13:03:13 PDT
Ah, I think the fix here is to have HTMLCanvasElement::memoryCost() forward the call to ImageBuffer::memoryCost() instead of doing an estimate.

The assertion happens because the external size is bigger than the estimate.
Comment 3 Andreas Kling 2016-08-26 13:50:05 PDT
Created attachment 287141 [details]
Patch
Comment 4 Joseph Pecoraro 2016-08-26 14:52:21 PDT
Comment on attachment 287141 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2016-08-26 15:43:30 PDT
Comment on attachment 287141 [details]
Patch

Clearing flags on attachment: 287141

Committed r205053: <http://trac.webkit.org/changeset/205053>
Comment 6 WebKit Commit Bot 2016-08-26 15:43:35 PDT
All reviewed patches have been landed.  Closing bug.