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

Issue 1675923002: Prevent data race in MessageQueue. (Closed)

Created:
4 years, 10 months ago by joachim
Modified:
4 years, 10 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Prevent data race in MessageQueue. The CL prevents a data race in MessageQueue where the variable "ss_" is modified without a lock while sometimes read inside a lock. Also thread annotations have been added to the MessageQueue class. BUG=webrtc:5496 Committed: https://crrev.com/df88460372e7ce78c871a87774d7e6d82aac6ee3 Cr-Commit-Position: refs/heads/master@{#11683}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Feedback from Peter #

Patch Set 3 : Fixed initialization order. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -37 lines) Patch
M webrtc/base/messagequeue.h View 1 3 chunks +14 lines, -8 lines 0 comments Download
M webrtc/base/messagequeue.cc View 1 2 5 chunks +52 lines, -27 lines 0 comments Download
M webrtc/base/thread.cc View 1 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 25 (10 generated)
joachim
Ptal, this should fix one of the data races found by TSan.
4 years, 10 months ago (2016-02-06 01:17:08 UTC) #2
ivoc
Thanks for helping to fix this! I'm not very familiar with this part of the ...
4 years, 10 months ago (2016-02-10 10:38:10 UTC) #3
pthatcher1
https://codereview.webrtc.org/1675923002/diff/1/webrtc/base/messagequeue.cc File webrtc/base/messagequeue.cc (right): https://codereview.webrtc.org/1675923002/diff/1/webrtc/base/messagequeue.cc#newcode175 webrtc/base/messagequeue.cc:175: ExclusiveScope es(&ss_lock_); Can you leave a comment explaining why ...
4 years, 10 months ago (2016-02-12 00:16:34 UTC) #5
joachim
Updated based on your feedback. https://codereview.chromium.org/1675923002/diff/1/webrtc/base/messagequeue.cc File webrtc/base/messagequeue.cc (right): https://codereview.chromium.org/1675923002/diff/1/webrtc/base/messagequeue.cc#newcode175 webrtc/base/messagequeue.cc:175: ExclusiveScope es(&ss_lock_); On 2016/02/12 ...
4 years, 10 months ago (2016-02-12 15:09:52 UTC) #6
joachim
On 2016/02/12 15:09:52, joachim wrote: > Updated based on your feedback. > > https://codereview.chromium.org/1675923002/diff/1/webrtc/base/messagequeue.cc > ...
4 years, 10 months ago (2016-02-12 15:11:08 UTC) #7
Taylor Brandstetter
lgtm
4 years, 10 months ago (2016-02-17 01:23:24 UTC) #8
pthatcher1
lgtm
4 years, 10 months ago (2016-02-19 05:02:28 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1675923002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1675923002/20001
4 years, 10 months ago (2016-02-19 07:13:16 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: ios64_sim_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/ios64_sim_dbg/builds/5247)
4 years, 10 months ago (2016-02-19 07:14:41 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1675923002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1675923002/40001
4 years, 10 months ago (2016-02-19 09:27:59 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: linux_baremetal on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_baremetal/builds/9110)
4 years, 10 months ago (2016-02-19 11:33:05 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1675923002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1675923002/40001
4 years, 10 months ago (2016-02-19 14:29:51 UTC) #21
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 10 months ago (2016-02-19 15:03:34 UTC) #22
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/df88460372e7ce78c871a87774d7e6d82aac6ee3 Cr-Commit-Position: refs/heads/master@{#11683}
4 years, 10 months ago (2016-02-19 15:03:46 UTC) #24
joachim
4 years, 10 months ago (2016-02-19 15:15:55 UTC) #25
Message was sent while issue was closed.
A revert of this CL (patchset #3 id:40001) has been created in
https://codereview.webrtc.org/1714463003/ by jbauch@webrtc.org.

The reason for reverting is: Broke chromium.webrtc.fyi bots:
https://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20Builder/build...
https://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20GN/builds/11416

Fails with
-----
Undefined symbols for architecture x86_64:
  "rtc::SharedExclusiveLock::LockShared()", referenced from:
      rtc::MessageQueue::DoDestroy() in librtc_base.a(messagequeue.o)
      rtc::MessageQueue::socketserver() in librtc_base.a(messagequeue.o)
      rtc::MessageQueue::WakeUpSocketServer() in librtc_base.a(messagequeue.o)
      rtc::MessageQueue::Quit() in librtc_base.a(messagequeue.o)
      rtc::MessageQueue::Get(rtc::Message*, int, bool) in
librtc_base.a(messagequeue.o)
      rtc::MessageQueue::Post(rtc::MessageHandler*, unsigned int,
rtc::MessageData*, bool) in librtc_base.a(messagequeue.o)
      rtc::MessageQueue::DoDelayPost(int, unsigned int, rtc::MessageHandler*,
unsigned int, rtc::MessageData*) in librtc_base.a(messagequeue.o)
      ...
  "rtc::SharedExclusiveLock::UnlockShared()", referenced from:
      rtc::MessageQueue::DoDestroy() in librtc_base.a(messagequeue.o)
      rtc::MessageQueue::socketserver() in librtc_base.a(messagequeue.o)
      rtc::MessageQueue::WakeUpSocketServer() in librtc_base.a(messagequeue.o)
      rtc::MessageQueue::Quit() in librtc_base.a(messagequeue.o)
      rtc::MessageQueue::Get(rtc::Message*, int, bool) in
librtc_base.a(messagequeue.o)
      rtc::MessageQueue::Post(rtc::MessageHandler*, unsigned int,
rtc::MessageData*, bool) in librtc_base.a(messagequeue.o)
      rtc::MessageQueue::DoDelayPost(int, unsigned int, rtc::MessageHandler*,
unsigned int, rtc::MessageData*) in librtc_base.a(messagequeue.o)
      ...
  "rtc::SharedExclusiveLock::SharedExclusiveLock()", referenced from:
      rtc::MessageQueue::MessageQueue(rtc::SocketServer*, bool) in
librtc_base.a(messagequeue.o)
ld: symbol(s) not found for architecture x86_64
-----

Looks like these are compiling without "webrtc/base/sharedexclusivelock.cc"..

Powered by Google App Engine
This is Rietveld 408576698