Bug 158560

Summary: [Threaded Compositor] Many layout tests crash when threaded compositor is enabled
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, yoon, zan
Priority: P2 Keywords: Gtk
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 154066    
Attachments:
Description Flags
Patch zan: review+

Description Carlos Garcia Campos 2016-06-09 03:27:02 PDT
Program received signal SIGSEGV, Segmentation fault.
0x00007fb30dca017b in WebCore::CoordinatedGraphicsLayer::notifyFlushRequired() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
(gdb) bt
#0  0x00007fb30dca017b in WebCore::CoordinatedGraphicsLayer::notifyFlushRequired() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#1  0x00007fb30dca12f9 in WebCore::CoordinatedGraphicsLayer::didChangeGeometry() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#2  0x00007fb30d951781 in WebCore::RenderLayerCompositor::ensureRootLayer() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#3  0x00007fb30d9518d1 in WebCore::RenderLayerCompositor::enableCompositingMode(bool) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#4  0x00007fb30d953a76 in WebCore::RenderLayerCompositor::updateCompositingLayers(WebCore::CompositingUpdateType, WebCore::RenderLayer*) [clone .part.263] [clone .constprop.273] ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#5  0x00007fb30d6458a9 in WebCore::FrameView::layout(bool) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#6  0x00007fb30d6466e1 in WebCore::FrameView::updateContentsSize() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#7  0x00007fb30d6ea6d8 in WebCore::ScrollView::updateScrollbars(WebCore::IntPoint const&) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#8  0x00007fb30d6eafc2 in WebCore::ScrollView::setContentsSize(WebCore::IntSize const&) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#9  0x00007fb30d645176 in WebCore::FrameView::setContentsSize(WebCore::IntSize const&) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#10 0x00007fb30d6452d1 in WebCore::FrameView::adjustViewSize() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#11 0x00007fb30d646086 in WebCore::FrameView::layout(bool) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#12 0x00007fb30d646a2d in WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#13 0x00007fb30cd92046 in WebKit::DrawingAreaImpl::updateBackingStoreState(unsigned long, bool, float, WebCore::IntSize const&, WebCore::IntSize const&) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#14 0x00007fb30cdefe73 in WebKit::DrawingArea::didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#15 0x00007fb30cad8e59 in IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::MessageDecoder&) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#16 0x00007fb30cc01216 in WebKit::WebProcess::didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#17 0x00007fb30cad5246 in IPC::Connection::dispatchMessage(std::unique_ptr<IPC::MessageDecoder, std::default_delete<IPC::MessageDecoder> >) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#18 0x00007fb30cad5ba3 in IPC::Connection::dispatchOneMessage() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#19 0x00007fb30b6edf32 in WTF::RunLoop::performWork() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#20 0x00007fb30b71d069 in WTF::RunLoop::RunLoop()::{lambda(void*)#1}::_FUN(void*) () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#21 0x00007fb306913b8a in g_main_dispatch (context=0x8a2ee0) at gmain.c:3154
#22 g_main_context_dispatch (context=context@entry=0x8a2ee0) at gmain.c:3769
#23 0x00007fb306913f08 in g_main_context_iterate (context=0x8a2ee0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3840
#24 0x00007fb306914222 in g_main_loop_run (loop=0x101f4b0) at gmain.c:4034
#25 0x00007fb30b71d930 in WTF::RunLoop::run() () from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#26 0x00007fb30cd96ca2 in int WebKit::ChildProcessMain<WebKit::WebProcess, WebKit::WebProcessMain>(int, char**) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#27 0x00007fb301a355f0 in __libc_start_main (main=0x400af0 <main>, argc=2, argv=0x7ffdc729c8c8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7ffdc729c8b8) at libc-start.c:291
#28 0x0000000000400b49 in _start ()

This is because CoordinatedGraphicsLayer::notifyFlushRequired() assumes it has a valid compositor when it's called. But the compositor is only present when GraphicsLayer::create() is called with a GraphicsLayerFactory. When running the layout tests layers are created without a factory because DrawingAreaImpl is not entering the AC mode as expected and the layer tree host is not created, making DrawingAreaImpl::graphicsLayerFactory() always return false. This happens because DrawingAreaImpl is checking acceleratedDrawingEnabled setting to decide whether to always use compositing mode or not and WTR sets that setting to false (changing its default value). The thing is that acceleratedDrawingEnabled setting doesn't have any effect in non-Mac ports, what we really want to check there is whether acceleratedCompositingEnabled is true or false.
Comment 1 Carlos Garcia Campos 2016-06-09 03:30:50 PDT
Created attachment 280910 [details]
Patch
Comment 2 Carlos Garcia Campos 2016-06-09 05:08:03 PDT
Committed r201860: <http://trac.webkit.org/changeset/201860>