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

Issue 1318453002: Fix races with MessagePipeReader due to the Mojo IPC channel being thread-safe. (Closed)

Created:
5 years, 3 months ago by Anand Mistry (off Chromium)
Modified:
5 years, 3 months ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix races with MessagePipeReader due to the Mojo IPC channel being thread-safe. This change does three things: 1. Checks the threading of MessagePipeReader using a ThreadChecker. 2. Eliminates races on |pending_send_error_| by using atomic ops. 3. Documents and removes checks which are no longer valid because Send() can be called on a non-IO thread. BUG=522888, 492867 TESTED=Enabled Mojo IPC channel and ran StatsTableBrowserTest.StartWithStatTable with tsan 100 times. Before: IPC-related races and DCHECK failures After: No IPC-related races and DCHECK failures. Committed: https://crrev.com/0b0e7480d9fd3816cbee891bf1618bc02b112cb4 Cr-Commit-Position: refs/heads/master@{#346967}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address comment. #

Total comments: 2

Patch Set 3 : Add bug reference. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -13 lines) Patch
M ipc/mojo/ipc_message_pipe_reader.h View 1 2 4 chunks +15 lines, -3 lines 0 comments Download
M ipc/mojo/ipc_message_pipe_reader.cc View 1 7 chunks +22 lines, -10 lines 0 comments Download

Messages

Total messages: 25 (7 generated)
Anand Mistry (off Chromium)
rockot: Reviewer chosen on the ancient, scientific principal of "you touched it, you own it". ...
5 years, 3 months ago (2015-08-25 07:38:01 UTC) #2
Alexander Potapenko
I believe accesses to pending_send_error_ must have acquire/release semantics here. If my understanding your intent ...
5 years, 3 months ago (2015-08-25 11:22:34 UTC) #3
Anand Mistry (off Chromium)
I'll address the other comment tomorrow, but I'll address the memory semantics now. I think ...
5 years, 3 months ago (2015-08-25 12:16:08 UTC) #4
Alexander Potapenko
> I don't think so. There are no other memory accesses that need to be ...
5 years, 3 months ago (2015-08-25 12:46:30 UTC) #5
Anand Mistry (off Chromium)
On 2015/08/25 12:46:30, Alexander Potapenko wrote: > > I don't think so. There are no ...
5 years, 3 months ago (2015-08-25 13:04:18 UTC) #6
Anand Mistry (off Chromium)
https://codereview.chromium.org/1318453002/diff/1/ipc/mojo/ipc_message_pipe_reader.cc File ipc/mojo/ipc_message_pipe_reader.cc (right): https://codereview.chromium.org/1318453002/diff/1/ipc/mojo/ipc_message_pipe_reader.cc#newcode56 ipc/mojo/ipc_message_pipe_reader.cc:56: CloseWithError(pending_send_error()); On 2015/08/25 11:22:34, Alexander Potapenko wrote: > Why ...
5 years, 3 months ago (2015-08-26 03:43:19 UTC) #7
Ken Rockot(use gerrit already)
lgtm https://codereview.chromium.org/1318453002/diff/20001/ipc/mojo/ipc_message_pipe_reader.h File ipc/mojo/ipc_message_pipe_reader.h (right): https://codereview.chromium.org/1318453002/diff/20001/ipc/mojo/ipc_message_pipe_reader.h#newcode109 ipc/mojo/ipc_message_pipe_reader.h:109: // TODO(amistry): This isn't quite right because handles ...
5 years, 3 months ago (2015-08-26 06:13:53 UTC) #8
Anand Mistry (off Chromium)
https://codereview.chromium.org/1318453002/diff/20001/ipc/mojo/ipc_message_pipe_reader.h File ipc/mojo/ipc_message_pipe_reader.h (right): https://codereview.chromium.org/1318453002/diff/20001/ipc/mojo/ipc_message_pipe_reader.h#newcode109 ipc/mojo/ipc_message_pipe_reader.h:109: // TODO(amistry): This isn't quite right because handles can ...
5 years, 3 months ago (2015-08-26 07:19:17 UTC) #9
Alexander Potapenko
I'm convinced, LGTM :)
5 years, 3 months ago (2015-08-26 13:56:33 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1318453002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1318453002/40001
5 years, 3 months ago (2015-08-26 22:03:06 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/93302)
5 years, 3 months ago (2015-08-26 22:18:06 UTC) #15
Anand Mistry (off Chromium)
agl@chromium.org: Please review changes because owners.
5 years, 3 months ago (2015-08-26 22:21:59 UTC) #17
Anand Mistry (off Chromium)
On 2015/08/26 22:21:59, Anand Mistry wrote: > mailto:agl@chromium.org: Please review changes because owners. ag: Ping!
5 years, 3 months ago (2015-08-31 21:46:50 UTC) #18
Anand Mistry (off Chromium)
-agl, +jam for IPC owners.
5 years, 3 months ago (2015-09-01 22:17:25 UTC) #20
jam
lgtm
5 years, 3 months ago (2015-09-02 05:58:19 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1318453002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1318453002/40001
5 years, 3 months ago (2015-09-02 16:51:50 UTC) #23
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 3 months ago (2015-09-02 18:04:31 UTC) #24
commit-bot: I haz the power
5 years, 3 months ago (2015-09-02 18:05:50 UTC) #25
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/0b0e7480d9fd3816cbee891bf1618bc02b112cb4
Cr-Commit-Position: refs/heads/master@{#346967}

Powered by Google App Engine
This is Rietveld 408576698