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

Issue 661339: Fixed a startup race condition.... (Closed)

Created:
10 years, 9 months ago by MAD
Modified:
8 years, 8 months ago
CC:
chromium-reviews, ben+cc_chromium.org
Visibility:
Public.

Description

Fixed a startup race condition. Although the new test was written in a platform independent way, it is only added to the Widows specific portion of the ui_test target in the gyp file because it wasn't tried yet on the other platforms. The bug was found and the fix was written in the windows specific version of the process singleton anyway... But if people working on the other platforms would like to try the test there, that would be great. :-) BUG=9593 TEST=A new test have been created to validate this. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=40629

Patch Set 1 #

Total comments: 12

Patch Set 2 : '' #

Total comments: 16

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 6

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+304 lines, -6 lines) Patch
M chrome/browser/process_singleton_win.cc View 1 2 3 4 5 6 7 8 3 chunks +34 lines, -6 lines 1 comment Download
A chrome/browser/process_singleton_win_uitest.cc View 1 2 3 4 5 6 7 8 1 chunk +266 lines, -0 lines 1 comment Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
MAD
10 years, 9 months ago (2010-03-02 01:24:04 UTC) #1
Paweł Hajdan Jr.
Drive-by with some test comments. http://codereview.chromium.org/661339/diff/1/3 File chrome/browser/process_singleton_win_uitest.cc (right): http://codereview.chromium.org/661339/diff/1/3#newcode63 chrome/browser/process_singleton_win_uitest.cc:63: EXPECT_NE(static_cast<base::WaitableEvent*>(NULL), start_event); This should ...
10 years, 9 months ago (2010-03-02 09:24:37 UTC) #2
MAD
Thanks for the drive by... Changes uploaded... BYE MAD http://codereview.chromium.org/661339/diff/1/3 File chrome/browser/process_singleton_win_uitest.cc (right): http://codereview.chromium.org/661339/diff/1/3#newcode63 chrome/browser/process_singleton_win_uitest.cc:63: ...
10 years, 9 months ago (2010-03-02 14:33:21 UTC) #3
Paweł Hajdan Jr.
Thanks, the fixes look good. I just spotted the Sleep I overlooked before. Could you ...
10 years, 9 months ago (2010-03-02 14:42:44 UTC) #4
MAD
http://codereview.chromium.org/661339/diff/6/8 File chrome/browser/process_singleton_win_uitest.cc (right): http://codereview.chromium.org/661339/diff/6/8#newcode221 chrome/browser/process_singleton_win_uitest.cc:221: PlatformThread::Sleep(100); On 2010/03/02 14:42:44, Paweł Hajdan Jr. wrote: > ...
10 years, 9 months ago (2010-03-02 14:59:11 UTC) #5
robertshield
http://codereview.chromium.org/661339/diff/6/7 File chrome/browser/process_singleton_win.cc (right): http://codereview.chromium.org/661339/diff/6/7#newcode46 chrome/browser/process_singleton_win.cc:46: HANDLE only_me = ::CreateMutex(NULL, FALSE, L"Global\\ProcessSingleton"); Shouldn't the object ...
10 years, 9 months ago (2010-03-02 15:06:14 UTC) #6
MAD
I'll send an update of the patch once I confirm if it is worth adding ...
10 years, 9 months ago (2010-03-02 16:45:57 UTC) #7
robertshield
Thanks, everything looks good, I think we just need better clean up of the lingering ...
10 years, 9 months ago (2010-03-02 17:03:15 UTC) #8
cpu_(ooo_6.6-7.5)
I am a little bit lost here. http://codereview.chromium.org/661339/diff/1015/19 File chrome/browser/process_singleton_win.cc (right): http://codereview.chromium.org/661339/diff/1015/19#newcode47 chrome/browser/process_singleton_win.cc:47: ScopedHandle only_me(CreateMutex(NULL, ...
10 years, 9 months ago (2010-03-02 19:15:58 UTC) #9
MAD
Uploaded an updated version and answered comments. Thanks! BYE MAD http://codereview.chromium.org/661339/diff/1015/19 File chrome/browser/process_singleton_win.cc (right): http://codereview.chromium.org/661339/diff/1015/19#newcode47 ...
10 years, 9 months ago (2010-03-02 19:57:10 UTC) #10
cpu_(ooo_6.6-7.5)
lgtm
10 years, 9 months ago (2010-03-02 22:15:44 UTC) #11
MAD
Cool Thanks! BYE MAD On Tue, Mar 2, 2010 at 5:15 PM, <cpu@chromium.org> wrote: > ...
10 years, 9 months ago (2010-03-02 22:56:57 UTC) #12
MAD
OK, can you guys (Robert and/or Pawel) take one more look at the unit test? ...
10 years, 9 months ago (2010-03-03 22:46:14 UTC) #13
Paweł Hajdan Jr.
LGTM, thanks for the work on making this solid!
10 years, 9 months ago (2010-03-04 07:22:17 UTC) #14
robertshield
LGTM
10 years, 9 months ago (2010-03-04 14:25:37 UTC) #15
Nico
http://codereview.chromium.org/661339/diff/2006/chrome/browser/process_singleton_win_uitest.cc File chrome/browser/process_singleton_win_uitest.cc (right): http://codereview.chromium.org/661339/diff/2006/chrome/browser/process_singleton_win_uitest.cc#newcode258 chrome/browser/process_singleton_win_uitest.cc:258: pending_starters.empty(); Vectors are cleared with "clear()", empty() just returns ...
8 years, 8 months ago (2012-04-11 03:18:59 UTC) #16
Sigurður Ásgeirsson
8 years, 8 months ago (2012-04-11 12:17:40 UTC) #17
Drive-by, did not review in detail.

http://codereview.chromium.org/661339/diff/2006/chrome/browser/process_single...
File chrome/browser/process_singleton_win.cc (right):

http://codereview.chromium.org/661339/diff/2006/chrome/browser/process_single...
chrome/browser/process_singleton_win.cc:58: DWORD result =
WaitForSingleObject(only_me, INFINITE);
WFSO can also return WAIT_ABANDONED for success. This is in the case when the
previous owner of the mutex died or was killed before releasing it.
See
http://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx

I believe you can test this condition by grabbing the mutex, then closing that
handle. This should implicitly release it into the abandoned state.

Powered by Google App Engine
This is Rietveld 408576698