Bug 22341 - Text codecs should not use static data without locking
Summary: Text codecs should not use static data without locking
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-18 12:43 PST by Alexey Proskuryakov
Modified: 2008-11-19 09:58 PST (History)
0 users

See Also:


Attachments
proposed patch (7.36 KB, patch)
2008-11-18 12:46 PST, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff
now with more correctness built-in (9.02 KB, patch)
2008-11-19 06:20 PST, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2008-11-18 12:43:16 PST
Text encoding machinery is used by KURL, and KURL is used by workers.

Patch forthcoming.
Comment 1 Alexey Proskuryakov 2008-11-18 12:46:13 PST
Created attachment 25244 [details]
proposed patch
Comment 2 Alexey Proskuryakov 2008-11-18 12:49:02 PST
P1, because I've actually seen crashes because of this on Windows.
Comment 3 Darin Adler 2008-11-18 12:59:36 PST
Comment on attachment 25244 [details]
proposed patch

> +    AtomicallyInitializedStatic(Mutex*, mutex = new Mutex);

I should have mentioned this long ago: Macros should use the all-capitals style. We should rename this one since we're using it more and more. At some point. Not this patch.

r=me
Comment 4 Alexey Proskuryakov 2008-11-19 06:20:40 PST
Created attachment 25266 [details]
now with more correctness built-in

The previous patch was wrong in two ways - first, it caused deadlocks in text encoding registry, and second, it's not really correct to move codecs between threads, even if protected with locks.
Comment 5 Darin Adler 2008-11-19 09:26:00 PST
Comment on attachment 25266 [details]
now with more correctness built-in

r=me
Comment 6 Alexey Proskuryakov 2008-11-19 09:58:14 PST
Committed revision 38597.