Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Issue 2877983004: [TSAN] Fix TSAN error in i18n RTL. (Closed)

Created:
3 years, 7 months ago by mbjorge
Modified:
3 years, 7 months ago
Reviewers:
jungshik at Google
CC:
chromium-reviews, danakj+watch_chromium.org, jshin+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[TSAN] Fix TSAN error in i18n RTL. Use an atomic to protect the global g_icu_text_direction cached value from multiple readers/writers. Also reduce acccess to g_icu_text_diretion so it only has a single write location (in SetICUDefaultLocal) and a single read location (ICUIsRTL), to simplify the race-y-ness. Outside of test code, SetICUDefaultLocal is only used in two locations: ppapi_plugin_main.cc and l10n_util.cc, whereas IsRTL is used in >100 places outside of test code, so it seemed reasonable to move the heavy logic (updating g_icu_text_direction when it changes) into what I imagine to be a function that is called rarely and let the one that is used a lot (IsRTL/ICUIsRTL) just do a simple read. This still still leaves a race condition in that IsRTL may give in inaccurate result if SetICUDefaultLocale is executed at the same time. In particular, IsRTL may return the value for the previously set default locale after the default locale has been updated. BUG=695929 TEST=cast_shell_browsertests under TSAN before/after Review-Url: https://codereview.chromium.org/2877983004 Cr-Commit-Position: refs/heads/master@{#472890} Committed: https://chromium.googlesource.com/chromium/src/+/89c24d4a46c1f0e7ad03891a659e6d23dc776c36

Patch Set 1 #

Patch Set 2 : Be consistent casting things #

Patch Set 3 : fix typo in type name #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -7 lines) Patch
M base/i18n/rtl.cc View 1 2 4 chunks +12 lines, -7 lines 0 comments Download

Messages

Total messages: 15 (7 generated)
mbjorge
3 years, 7 months ago (2017-05-14 07:44:26 UTC) #2
jungshik at Google
Didn't I review this already (another CL? )? Or, am I dreaming? :-) Anyway, thanks. ...
3 years, 7 months ago (2017-05-17 22:18:59 UTC) #4
mbjorge
On 2017/05/17 at 22:18:59, jshin wrote: > Didn't I review this already (another CL? )? ...
3 years, 7 months ago (2017-05-17 22:34:34 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2877983004/40001
3 years, 7 months ago (2017-05-17 22:35:41 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/447883)
3 years, 7 months ago (2017-05-18 04:50:58 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2877983004/40001
3 years, 7 months ago (2017-05-18 17:12:28 UTC) #11
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/89c24d4a46c1f0e7ad03891a659e6d23dc776c36
3 years, 7 months ago (2017-05-18 18:54:11 UTC) #14
mbjorge
3 years, 6 months ago (2017-05-31 00:55:42 UTC) #15
Message was sent while issue was closed.
A revert of this CL (patchset #3 id:40001) has been created in
https://codereview.chromium.org/2917523002/ by mbjorge@chromium.org.

The reason for reverting is: Appears to break the Force UI Direction / Force
Text Direction / FOrce RTL flags on mac.

BUG=727229.

Powered by Google App Engine
This is Rietveld 408576698