Closed Bug 1506868 Opened 6 years ago Closed 6 years ago

Mitigate TSan false positives for thread-safe refcounting

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: ytausky, Assigned: ytausky)

Details

Attachments

(1 file)

TSan doesn't support std::atomic_thread_fence, so this line causes a lot of noise when using it: https://searchfox.org/mozilla-central/source/xpcom/base/nsISupportsImpl.h#358
Replacing the fence with an atomic load-acquire when building with -fsanitize=thread clears up the output and is more resilient than simply suppressing the error message.
TSan doesn't support std::atomic_thread_fence, so in order to avoid noisy
output, we can replace the fence with an atomic load when building with
-fsanitize=thread. This is a better alternative than error message
suppression since it's closer to the relevant code and thus much likelier
to survive changes to it.
Keywords: checkin-needed
Assignee: nobody → ytausky
Pushed by rvandermeulen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/030c33c24d8c
Replace calls to std::atomic_thread_fence in TSan mode r=froydnj
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/030c33c24d8c
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: