Bug 130395 - [GTK] Race condition when the socket event source is cancelled
Summary: [GTK] Race condition when the socket event source is cancelled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2014-03-18 07:04 PDT by Carlos Garcia Campos
Modified: 2014-03-18 08:03 PDT (History)
6 users (show)

See Also:


Attachments
Patch (2.54 KB, patch)
2014-03-18 07:06 PDT, Carlos Garcia Campos
mrobinson: 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 2014-03-18 07:04:45 PDT
In some cases when the socket event source is cancelled the socket event source callback is called with the condition of the previous poll instead of 0. This can happen sometimes when the source is cancelled from the socket event source callback. Once the socket event source is cancelled, it's dispatched by glib without polling, so the condition is never reset again and the callback is called again and again with the previous condition. When the condition is G_IO_IN, the source is re-scheduled entering into an infinite loop. We should always check if the source has been cancelled at the beginning of the callback to destroy the source instead of relying on the condition being 0.
Comment 1 Carlos Garcia Campos 2014-03-18 07:06:46 PDT
Created attachment 227046 [details]
Patch
Comment 2 Carlos Garcia Campos 2014-03-18 08:03:26 PDT
Committed r165812: <http://trac.webkit.org/changeset/165812>