Bug 134392 - curl: Fix several deadlocks
Summary: curl: Fix several deadlocks
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Critical
Assignee: Basuke Suzuki
Depends on:
Blocks: 117300
  Show dependency treegraph
Reported: 2014-06-27 05:06 PDT by cand
Modified: 2018-02-28 09:13 PST (History)
7 users (show)

See Also:

Patch (1.01 KB, patch)
2014-06-27 05:07 PDT, cand
no flags Details | Formatted Diff | Diff
remove mutex (3.95 KB, patch)
2017-07-19 22:17 PDT, Basuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cand 2014-06-27 05:06:54 PDT
Mutexes on posix platforms are not recursive, unlike on Windows. CurlDownload tried to re-lock a mutex in several places, causing deadlocks.
Comment 1 cand 2014-06-27 05:07:23 PDT
Created attachment 233977 [details]
Comment 2 Peter Gal 2014-07-01 01:10:45 PDT
(In reply to comment #1)
> Created an attachment (id=233977) [details]
> Patch

This patch doesn't have a changelog and please mark patches with r? to be reviewed.
Comment 3 Basuke Suzuki 2017-07-19 22:17:19 PDT
Created attachment 315971 [details]
remove mutex

Because JobManager calls callback sequentially from phase to phase, there is no need to maintain thread safety by mutex. m_response is the only object which is touched from background and main thread, all header received event is the last method to touch the response and all manipulation is finished by that timing.
Comment 4 Basuke Suzuki 2017-07-19 22:18:13 PDT
This patch should be landed after following patch is landed.
- https://bugs.webkit.org/show_bug.cgi?id=134393
Comment 5 Basuke Suzuki 2018-02-28 09:13:30 PST
With the huge architecture change, this deadlocks are resolved. Actually those mutex was gone and was replaced with operation queue style architecture.