Bug 154682 - com.apple.WebKit.Networking.Development crashes in WebCore::formOpen()
Summary: com.apple.WebKit.Networking.Development crashes in WebCore::formOpen()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Local Build
Hardware: Mac Unspecified
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-02-25 10:04 PST by Daniel Bates
Modified: 2016-03-01 16:01 PST (History)
4 users (show)

See Also:


Attachments
Patch (2.83 KB, patch)
2016-02-25 10:22 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch (4.48 KB, patch)
2016-03-01 10:16 PST, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2016-02-25 10:04:08 PST
Crash reports show that com.apple.WebKit.Networking.Development can crash in WebCore::formOpen().
Comment 1 Daniel Bates 2016-02-25 10:04:29 PST
<rdar://problem/23550269>
Comment 2 Daniel Bates 2016-02-25 10:22:24 PST
Created attachment 272213 [details]
Patch
Comment 3 Brent Fulgham 2016-02-25 10:47:11 PST
Comment on attachment 272213 [details]
Patch

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

> Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp:182
> +    LockHolder locker(form->streamIsBeingOpenedLock);

This seems fine, but we should be careful that we don't do any further locking in the code that follows (or the code that is called by the following). I'm not aware of any such case, but we should be on the lookout for deadlocks after this change lands.
Comment 4 Daniel Bates 2016-03-01 10:13:24 PST
(In reply to comment #3)
> Comment on attachment 272213 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=272213&action=review
> 
> > Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp:182
> > +    LockHolder locker(form->streamIsBeingOpenedLock);
> 
> This seems fine, but we should be careful that we don't do any further
> locking in the code that follows 

Care will need to be taken when additional locks are used in this code to prevent deadlock/livelock.

> (or the code that is called by the following).

I will update the patch to assert that the added lock is held in WebCore::advanceCurrentStream() and WebCore::closeCurrentStream() to catch calls to these functions that are made without holding the lock.
Comment 5 Daniel Bates 2016-03-01 10:16:52 PST
Created attachment 272571 [details]
Patch
Comment 6 Brent Fulgham 2016-03-01 10:24:14 PST
Comment on attachment 272571 [details]
Patch

r=me. If EWS is green (ignore Windows right now) please land.
Comment 7 Daniel Bates 2016-03-01 16:01:23 PST
Comment on attachment 272571 [details]
Patch

Clearing flags on attachment: 272571

Committed r197424: <http://trac.webkit.org/changeset/197424>
Comment 8 Daniel Bates 2016-03-01 16:01:27 PST
All reviewed patches have been landed.  Closing bug.