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

Issue 2839213002: [Synchronization] Fix a crash in WaitableEventWatcher (Closed)

Created:
3 years, 8 months ago by atuchin
Modified:
3 years, 7 months ago
Reviewers:
danakj, scottmg
CC:
chromium-reviews, grt+watch_chromium.org, danakj+watch_chromium.org, wfh+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Synchronization] Fix a crash in WaitableEventWatcher. This CL fix a problem with closing windows event handle when some watcher is still waiting for that event. The MSDN says that the behaviour is 'undefined', and it crashes on Win7. Now WaitableEventWatcher duplicates handle and holds it until watching is finished. TEST=base_unittests/WaitableEventWatcherTest* BUG=704495 Review-Url: https://codereview.chromium.org/2839213002 Cr-Commit-Position: refs/heads/master@{#470502} Committed: https://chromium.googlesource.com/chromium/src/+/54d831564ddf3b5f69adee4dfc35e75cb8c419d3

Patch Set 1 #

Patch Set 2 : [Synchronization] Fix a crash in WaitableEventWatcher. #

Total comments: 18

Patch Set 3 : Review fixes #

Patch Set 4 : The sleep is removed in tests #

Patch Set 5 : Check the both variants. Change comments. #

Total comments: 13

Patch Set 6 : Rewrite some comments #

Total comments: 9

Patch Set 7 : The last nits is fixed #

Total comments: 1

Patch Set 8 : Rewrite the tests #

Total comments: 2

Patch Set 9 : The sleep() is returned back. #

Total comments: 3

Patch Set 10 : Fix grammar in comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -13 lines) Patch
M base/synchronization/waitable_event.h View 1 chunk +6 lines, -3 lines 0 comments Download
M base/synchronization/waitable_event_watcher.h View 1 2 3 4 5 3 chunks +10 lines, -2 lines 0 comments Download
M base/synchronization/waitable_event_watcher_unittest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +57 lines, -5 lines 0 comments Download
M base/synchronization/waitable_event_watcher_win.cc View 1 2 1 chunk +20 lines, -3 lines 0 comments Download
M base/win/object_watcher.h View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (15 generated)
atuchin
On 2017/04/26 15:58:01, atuchin wrote: > mailto:atuchin@yandex-team.ru changed reviewers: > + mailto:danakj@chromium.org Hi! Despite the ...
3 years, 8 months ago (2017-04-26 15:59:21 UTC) #3
scottmg
Nice find atuchin! (I added BUG=704495 to the description)
3 years, 7 months ago (2017-04-27 17:14:43 UTC) #6
danakj
https://codereview.chromium.org/2839213002/diff/20001/base/synchronization/waitable_event_watcher.h File base/synchronization/waitable_event_watcher.h (right): https://codereview.chromium.org/2839213002/diff/20001/base/synchronization/waitable_event_watcher.h#newcode60 base/synchronization/waitable_event_watcher.h:60: // it with a Watcher. But pay attention: if ...
3 years, 7 months ago (2017-04-27 20:01:08 UTC) #7
atuchin
On 2017/04/27 17:14:43, scottmg wrote: > Nice find atuchin! (I added BUG=704495 to the description) ...
3 years, 7 months ago (2017-04-28 06:43:31 UTC) #8
atuchin
Thanks for comments. https://codereview.chromium.org/2839213002/diff/20001/base/synchronization/waitable_event_watcher.h File base/synchronization/waitable_event_watcher.h (right): https://codereview.chromium.org/2839213002/diff/20001/base/synchronization/waitable_event_watcher.h#newcode60 base/synchronization/waitable_event_watcher.h:60: // it with a Watcher. But ...
3 years, 7 months ago (2017-04-28 06:44:30 UTC) #9
danakj
https://codereview.chromium.org/2839213002/diff/20001/base/synchronization/waitable_event_watcher.h File base/synchronization/waitable_event_watcher.h (right): https://codereview.chromium.org/2839213002/diff/20001/base/synchronization/waitable_event_watcher.h#newcode60 base/synchronization/waitable_event_watcher.h:60: // it with a Watcher. But pay attention: if ...
3 years, 7 months ago (2017-04-28 17:54:49 UTC) #12
atuchin
https://codereview.chromium.org/2839213002/diff/20001/base/synchronization/waitable_event_watcher.h File base/synchronization/waitable_event_watcher.h (right): https://codereview.chromium.org/2839213002/diff/20001/base/synchronization/waitable_event_watcher.h#newcode60 base/synchronization/waitable_event_watcher.h:60: // it with a Watcher. But pay attention: if ...
3 years, 7 months ago (2017-05-02 07:41:19 UTC) #13
danakj
https://codereview.chromium.org/2839213002/diff/80001/base/synchronization/waitable_event_watcher.h File base/synchronization/waitable_event_watcher.h (right): https://codereview.chromium.org/2839213002/diff/80001/base/synchronization/waitable_event_watcher.h#newcode98 base/synchronization/waitable_event_watcher.h:98: // A watcher for |duplicated_event_handle_|. It MUST outlive that ...
3 years, 7 months ago (2017-05-02 14:46:22 UTC) #14
atuchin
https://codereview.chromium.org/2839213002/diff/80001/base/synchronization/waitable_event_watcher.h File base/synchronization/waitable_event_watcher.h (right): https://codereview.chromium.org/2839213002/diff/80001/base/synchronization/waitable_event_watcher.h#newcode98 base/synchronization/waitable_event_watcher.h:98: // A watcher for |duplicated_event_handle_|. It MUST outlive that ...
3 years, 7 months ago (2017-05-03 13:01:58 UTC) #15
danakj
Thanks, the comments are better now. LGTM w/ a few spelling/grammer fixes. https://codereview.chromium.org/2839213002/diff/80001/base/synchronization/waitable_event_watcher_unittest.cc File base/synchronization/waitable_event_watcher_unittest.cc ...
3 years, 7 months ago (2017-05-03 14:50:03 UTC) #16
atuchin
Ok, I fixed the last nits. Thanks for the review!
3 years, 7 months ago (2017-05-04 03:45:50 UTC) #17
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/2839213002/120001
3 years, 7 months ago (2017-05-04 03:46:22 UTC) #20
atuchin
Houston, we have a problem=) Unfortunately, DeleteSoon for the watcher was an illusion. The message ...
3 years, 7 months ago (2017-05-04 15:57:09 UTC) #22
danakj
https://codereview.chromium.org/2839213002/diff/120001/base/synchronization/waitable_event_watcher_unittest.cc File base/synchronization/waitable_event_watcher_unittest.cc (right): https://codereview.chromium.org/2839213002/diff/120001/base/synchronization/waitable_event_watcher_unittest.cc#newcode149 base/synchronization/waitable_event_watcher_unittest.cc:149: } What if you RunLoop().Run() here to let the ...
3 years, 7 months ago (2017-05-04 16:09:38 UTC) #23
danakj
On Thu, May 4, 2017 at 1:02 PM, <atuchin@yandex-team.ru> wrote: > > > 23:09, May ...
3 years, 7 months ago (2017-05-04 17:17:04 UTC) #24
atuchin
On 2017/05/04 17:17:04, danakj wrote: > On Thu, May 4, 2017 at 1:02 PM, <mailto:atuchin@yandex-team.ru> ...
3 years, 7 months ago (2017-05-05 05:59:48 UTC) #25
danakj
LGTM https://codereview.chromium.org/2839213002/diff/160001/base/synchronization/waitable_event_watcher_unittest.cc File base/synchronization/waitable_event_watcher_unittest.cc (right): https://codereview.chromium.org/2839213002/diff/160001/base/synchronization/waitable_event_watcher_unittest.cc#newcode142 base/synchronization/waitable_event_watcher_unittest.cc:142: // Unfortunately, that thread is under OS control ...
3 years, 7 months ago (2017-05-05 14:38:05 UTC) #26
danakj
https://codereview.chromium.org/2839213002/diff/160001/base/synchronization/waitable_event_watcher_unittest.cc File base/synchronization/waitable_event_watcher_unittest.cc (right): https://codereview.chromium.org/2839213002/diff/160001/base/synchronization/waitable_event_watcher_unittest.cc#newcode138 base/synchronization/waitable_event_watcher_unittest.cc:138: if (delay_after_delete) { Oh, maybe it's worth but I'm ...
3 years, 7 months ago (2017-05-05 14:38:50 UTC) #27
danakj
On Fri, May 5, 2017 at 2:26 PM, <atuchin@yandex-team.ru> wrote: > > > 21:38, May ...
3 years, 7 months ago (2017-05-05 20:19:26 UTC) #28
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/2839213002/160001
3 years, 7 months ago (2017-05-10 03:54:29 UTC) #31
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/2839213002/180001
3 years, 7 months ago (2017-05-10 03:58:17 UTC) #34
commit-bot: I haz the power
3 years, 7 months ago (2017-05-10 06:30:21 UTC) #37
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/54d831564ddf3b5f69adee4dfc35...

Powered by Google App Engine
This is Rietveld 408576698