Bug 160197 - [Threaded Compositor] ASSERTION FAILED: isMainThread() when ThreadedCompositor is destroyed since r203718
Summary: [Threaded Compositor] ASSERTION FAILED: isMainThread() when ThreadedComposito...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2016-07-26 08:59 PDT by Carlos Garcia Campos
Modified: 2016-07-26 09:26 PDT (History)
1 user (show)

See Also:


Attachments
Patch (10.70 KB, patch)
2016-07-26 09:06 PDT, Carlos Garcia Campos
zan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2016-07-26 08:59:20 PDT
ThreadedCompositor can be destroyed from a secondary thread, for example, when a task takes a reference and the main threads derefs it, when the task finishes in the secondary thread the lambda ends up deleting the threaded compositor. This is ok for the Threaded compositor but not for the CompositingRunLoop class. this was not a problem before r203718 because the CompositingRunLoop object was created and destroyed in the same thread always, but now it's part of the ThreadedCompositor class. This makes me think whether we really want this to happen, maybe instead of taking references, we should use weak pointers, but for now let's make sure the CompositingRunLoop is always created and destroyed in the main thread.

STDERR: ASSERTION FAILED: isMainThread()
STDERR: ../../Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp(44) : static WebKit::WorkQueuePool& WebKit::WorkQueuePool::singleton()
STDERR: 1   0x7fb8ba53ec2f /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(WTFCrash+0x1e) [0x7fb8ba53ec2f]
STDERR: 2   0x7fb8c104ce67 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebKit::WorkQueuePool::singleton()+0x37) [0x7fb8c104ce67]
STDERR: 3   0x7fb8c104c37b /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebKit::CompositingRunLoop::~CompositingRunLoop()+0x11) [0x7fb8c104c37b]
STDERR: 4   0x7fb8c10503ae /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebKit::ThreadedCompositor::~ThreadedCompositor()+0x72) [0x7fb8c10503ae]
STDERR: 5   0x7fb8c1050426 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebKit::ThreadedCompositor::~ThreadedCompositor()+0x18) [0x7fb8c1050426]
STDERR: 6   0x7fb8c1058d90 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WTF::ThreadSafeRefCounted<WebKit::ThreadedCompositor>::deref()+0x48) [0x7fb8c1058d90]
STDERR: 7   0x7fb8c1057f79 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WTF::Ref<WebKit::ThreadedCompositor>::~Ref()+0x2b) [0x7fb8c1057f79]
STDERR: 8   0x7fb8c10504ac /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(+0x58664ac) [0x7fb8c10504ac]
STDERR: 9   0x7fb8c1054baa /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(+0x586abaa) [0x7fb8c1054baa]
STDERR: 10  0x7fb8c1054be6 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(+0x586abe6) [0x7fb8c1054be6]
STDERR: 11  0x7fb8c0a44b38 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(std::default_delete<WTF::Function<void ()>::CallableWrapperBase>::operator()(WTF::Function<void ()>::CallableWrapperBase*) const+0x2e) [0x7fb8c0a44b38]
STDERR: 12  0x7fb8c0a42ab9 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(std::unique_ptr<WTF::Function<void ()>::CallableWrapperBase, std::default_delete<WTF::Function<void ()>::CallableWrapperBase> >::~unique_ptr()+0x47) [0x7fb8c0a42ab9]
STDERR: 13  0x7fb8c0a41a3c /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WTF::Function<void ()>::~Function()+0x18) [0x7fb8c0a41a3c]
STDERR: 14  0x7fb8c104c4b4 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(+0x58624b4) [0x7fb8c104c4b4]
STDERR: 15  0x7fb8c104cca0 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(+0x5862ca0) [0x7fb8c104cca0]
STDERR: 16  0x7fb8c104ccdc /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(+0x5862cdc) [0x7fb8c104ccdc]
STDERR: 17  0x7fb8c0a44b38 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(std::default_delete<WTF::Function<void ()>::CallableWrapperBase>::operator()(WTF::Function<void ()>::CallableWrapperBase*) const+0x2e) [0x7fb8c0a44b38]
STDERR: 18  0x7fb8c0a42ab9 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(std::unique_ptr<WTF::Function<void ()>::CallableWrapperBase, std::default_delete<WTF::Function<void ()>::CallableWrapperBase> >::~unique_ptr()+0x47) [0x7fb8c0a42ab9]
STDERR: 19  0x7fb8c0a41a3c /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WTF::Function<void ()>::~Function()+0x18) [0x7fb8c0a41a3c]
STDERR: 20  0x7fb8ba59af24 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(+0x227ef24) [0x7fb8ba59af24]
STDERR: 21  0x7fb8ba59bd9c /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(+0x227fd9c) [0x7fb8ba59bd9c]
STDERR: 22  0x7fb8ba59bdd8 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(+0x227fdd8) [0x7fb8ba59bdd8]
STDERR: 23  0x7fb8c0a44b38 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(std::default_delete<WTF::Function<void ()>::CallableWrapperBase>::operator()(WTF::Function<void ()>::CallableWrapperBase*) const+0x2e) [0x7fb8c0a44b38]
STDERR: 24  0x7fb8c0a42ab9 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(std::unique_ptr<WTF::Function<void ()>::CallableWrapperBase, std::default_delete<WTF::Function<void ()>::CallableWrapperBase> >::~unique_ptr()+0x47) [0x7fb8c0a42ab9]
STDERR: 25  0x7fb8c0a41a3c /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WTF::Function<void ()>::~Function()+0x18) [0x7fb8c0a41a3c]
STDERR: 26  0x7fb8ba55a49e /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(WTF::RunLoop::performWork()+0xe8) [0x7fb8ba55a49e]
STDERR: 27  0x7fb8ba59d2be /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(+0x22812be) [0x7fb8ba59d2be]
STDERR: 28  0x7fb8ba59d2e3 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(+0x22812e3) [0x7fb8ba59d2e3]
STDERR: 29  0x7fb8ba59d25e /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(+0x228125e) [0x7fb8ba59d25e]
STDERR: 30  0x7fb8ba59d28d /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(+0x228128d) [0x7fb8ba59d28d]
STDERR: 31  0x7fb8b6001a26 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/DependenciesGTK/Root/lib/libglib-2.0.so.0(+0x53a26) [0x7fb8b6001a26]
Comment 1 Carlos Garcia Campos 2016-07-26 09:06:25 PDT
Created attachment 284595 [details]
Patch
Comment 2 Carlos Garcia Campos 2016-07-26 09:26:48 PDT
Committed r203721: <http://trac.webkit.org/changeset/203721>