Bug 140998 - [GTK] Runtime critical warnings sometimes at start up when using the network process
Summary: [GTK] Runtime critical warnings sometimes at start up when using the network ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2015-01-28 07:42 PST by Carlos Garcia Campos
Modified: 2015-01-29 23:23 PST (History)
4 users (show)

See Also:


Attachments
Patch (3.49 KB, patch)
2015-01-28 07:46 PST, 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 2015-01-28 07:42:37 PST
(WebKitWebProcess:1594): GLib-CRITICAL **: g_main_loop_run: assertion 'loop != NULL' failed

(WebKitWebProcess:1617): GLib-CRITICAL **: g_main_loop_run: assertion 'loop != NULL' failed

(WebKitWebProcess:1609): GLib-CRITICAL **: g_main_loop_run: assertion 'loop != NULL' failed

(WebKitWebProcess:1613): GLib-CRITICAL **: g_main_loop_run: assertion 'loop != NULL' failed

(WebKitWebProcess:1638): GLib-CRITICAL **: g_main_loop_run: assertion 'loop != NULL' failed

This is caused by the CustomProtocolManager work queue theread. This WorkQueue is created when the CustomProtocolManager object is constructed, but destroyed when it's initialized when the UI process asks to use the network process. In this case, sometimes happens that the work queue thread that runs the main loop is executed once the object has been destroyed and the main loop pointer is null.
Comment 1 Carlos Garcia Campos 2015-01-28 07:46:04 PST
Created attachment 245542 [details]
Patch

Detach the worker thread when the work queue is destroyed, right before deleting the main loop
Comment 2 WebKit Commit Bot 2015-01-28 07:47:39 PST
Attachment 245542 [details] did not pass style-queue:


ERROR: Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp:55:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Zan Dobersek 2015-01-29 01:58:57 PST
Comment on attachment 245542 [details]
Patch

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

> Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp:55
> -    m_workQueueThread = createThread(reinterpret_cast<WTF::ThreadFunction>(&WorkQueue::startWorkQueueThread), this, threadName);
> +    m_workQueueThread = createThread(threadName, [this] { g_main_loop_run(m_eventLoop.get()); });

WorkQueue is ref-counted. This should probably pass a RefPtr protector into the lambda.
Comment 4 Carlos Garcia Campos 2015-01-29 23:23:05 PST
Committed r179395: <http://trac.webkit.org/changeset/179395>