Bug 98099 - [Gtk] crash when accelerated composition is turned off
Summary: [Gtk] crash when accelerated composition is turned off
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: arno.
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-01 17:12 PDT by arno.
Modified: 2012-10-01 18:13 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.95 KB, patch)
2012-10-01 17:19 PDT, arno.
no flags Details | Formatted Diff | Diff
Patch (1.73 KB, patch)
2012-10-01 17:33 PDT, arno.
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description arno. 2012-10-01 17:12:16 PDT
Hi,
when a accelerated composition is turned off on a page (for example, because no element require compositing anymore), WebKitGTK often crashes in

#0  0xb68f063f in WebKit::AcceleratedCompositingContext::flushPendingLayerChanges() () from /home/arno/webkit/WebKit.upstream/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0
#1  0xb68f06f5 in WebKit::AcceleratedCompositingContext::flushAndRenderLayers() () from /home/arno/webkit/WebKit.upstream/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0
#2  0xb68f07e0 in WebKit::AcceleratedCompositingContext::layerFlushTimerFired() () from /home/arno/webkit/WebKit.upstream/WebKitBuild/Release/.libs/libwebkitgtk-3.0.so.0
#3  0xb68f0801 in WebKit::AcceleratedCompositingContext::layerFlushTimerFiredCallback(WebKit::AcceleratedCompositingContext*) ()

flushPendingLayerChanges is reached while m_rootLayer has been cleared, and this results in a crash.

This happens because frame->view()->updateLayoutAndStyleIfNeededRecursive() is called in flushAndRenderLayers, and this may result in root compositing layer being set to null.
Comment 1 arno. 2012-10-01 17:19:32 PDT
Created attachment 166579 [details]
Patch

patch proposal: check if compositing is enabled after call to updateLayoutAndStyleIfNeededRecursive
Comment 2 Martin Robinson 2012-10-01 17:24:11 PDT
Comment on attachment 166579 [details]
Patch

Nice fix. It probably makes sense to keep the check in both places, no?
Comment 3 arno. 2012-10-01 17:33:11 PDT
Created attachment 166581 [details]
Patch

updated patch
Comment 4 Martin Robinson 2012-10-01 17:34:52 PDT
Comment on attachment 166581 [details]
Patch

Thanks!
Comment 5 WebKit Review Bot 2012-10-01 18:13:53 PDT
Comment on attachment 166581 [details]
Patch

Clearing flags on attachment: 166581

Committed r130108: <http://trac.webkit.org/changeset/130108>
Comment 6 WebKit Review Bot 2012-10-01 18:13:56 PDT
All reviewed patches have been landed.  Closing bug.