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

Issue 2021253002: Skip profiles in GetLastOpenedProfiles that fail to initialize (Closed)

Created:
4 years, 6 months ago by WC Leung
Modified:
4 years, 6 months ago
CC:
chromium-reviews, rginda+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Skip profiles in GetLastOpenedProfiles that fail to initialize If a profile fails to initialize, a nullptr is returned when we create that profile, causing a DCHECK failure. However, if this happens in Release, the DCHECK is bypassed, and a vector with nullptrs is returned. This results in crashes because callsites of GetLastOpenedProfiles does not check for nullptrs. See #17 of the bug for a detailed analysis of the crash. BUG=614753 TEST= 1. Use a Windows version. 2. Start chromium with a new user data directory, e.g. chromium --user-data-dir=d:\datadir1 3. Create two extra profiles, so you have "Person 1", "Person 2" and "Person 3" 4. Exit by Ctrl+Shift+Q while the browser windows are still open. 5. Now remove the directory "Profile 1" in the user data directory. 6. Set the permission of the user data directory to deny creating new directories. (a) Right-click the directory, select "Properties". (b) Click "Advanced" (c) Click "Add" in "Permission" tab. (d) Click "Select a principal", type "EVERYONE" in the box, then press "Okay". (e) In the combo boxes, select "Type: Deny" and "Applies To: This folder only". (f) Select "Show advanced permissions". (g) Uncheck all, then check "Create folders / append data", which is at the lower left corner. (h) Click Ok in the three dialog boxes. 7. Start chromium again (repeat step (1)). Expected behavior: Before patch - crash. After patch - chromium starts with TWO browser windows in step 7. If step 6 is not taken - chromium starts with THREE browser windows in step 7 Committed: https://crrev.com/4552c5134b38e43f1169e10810820bd10e459aa4 Cr-Commit-Position: refs/heads/master@{#399102}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Removed the bad DCHECK, updated comments #

Total comments: 12

Patch Set 3 : Fix variable name clash (stupid me) #

Patch Set 4 : Fix bugs (the bug in #2 was not properly fixed) #

Patch Set 5 : Update comments in code % pkasting's comments #

Total comments: 2

Patch Set 6 : Add test, fix nits #

Total comments: 35

Patch Set 7 : AddAceToObjectsSecurityDescriptor removed, nits fixed #

Patch Set 8 : Removed test code #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -11 lines) Patch
M chrome/browser/profiles/profile.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_manager.h View 1 2 3 4 5 4 chunks +8 lines, -6 lines 0 comments Download
M chrome/browser/profiles/profile_manager.cc View 1 2 3 2 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/ui/startup/startup_browser_creator.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 61 (18 generated)
WC Leung
Anthony: PTAL. Roger: PTAL. You own nothing by now, but you're likely the one who ...
4 years, 6 months ago (2016-05-31 10:51:26 UTC) #3
Peter Kasting
https://codereview.chromium.org/2021253002/diff/1/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/2021253002/diff/1/chrome/browser/profiles/profile_manager.cc#newcode1344 chrome/browser/profiles/profile_manager.cc:1344: if (profile) { This code violates the prohibition on ...
4 years, 6 months ago (2016-05-31 11:41:09 UTC) #4
Roger Tawa OOO till Jul 10th
lgtm
4 years, 6 months ago (2016-05-31 14:17:48 UTC) #5
anthonyvd
lgtm % pkasting@'s comments. FWIW it looks like the DCHECK(profile) in ProfileManager::CreateAndInitializeProfile is wrong because ...
4 years, 6 months ago (2016-05-31 14:38:27 UTC) #6
WC Leung
On 2016/05/31 14:38:27, anthonyvd wrote: > lgtm % pkasting@'s comments. > > FWIW it looks ...
4 years, 6 months ago (2016-05-31 16:54:22 UTC) #7
WC Leung
Patch #2 uploaded to address Peter's comments. PTAL. https://codereview.chromium.org/2021253002/diff/1/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/2021253002/diff/1/chrome/browser/profiles/profile_manager.cc#newcode1344 chrome/browser/profiles/profile_manager.cc:1344: if ...
4 years, 6 months ago (2016-05-31 17:41:07 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2021253002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2021253002/20001
4 years, 6 months ago (2016-05-31 17:41:56 UTC) #10
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_chromium_compile_only_ng/builds/145465) chromeos_x86-generic_chromium_compile_only_ng on ...
4 years, 6 months ago (2016-05-31 17:55:48 UTC) #12
Peter Kasting
LGTM https://codereview.chromium.org/2021253002/diff/20001/chrome/browser/profiles/profile.h File chrome/browser/profiles/profile.h (right): https://codereview.chromium.org/2021253002/diff/20001/chrome/browser/profiles/profile.h#newcode133 chrome/browser/profiles/profile.h:133: // profile directory fails, nullptr is returned. You ...
4 years, 6 months ago (2016-05-31 19:12:30 UTC) #13
WC Leung
On 2016/05/31 16:54:22, WC Leung wrote: > On 2016/05/31 14:38:27, anthonyvd wrote: > > > ...
4 years, 6 months ago (2016-06-01 15:47:07 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2021253002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2021253002/60001
4 years, 6 months ago (2016-06-01 16:13:29 UTC) #16
WC Leung
Finally I've successful repro'ed the bug. Turn out I need to disable only "create folder" ...
4 years, 6 months ago (2016-06-01 16:44:33 UTC) #17
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-01 17:29:42 UTC) #19
WC Leung
On 2016/06/01 16:44:33, WC Leung wrote: > Finally I've successful repro'ed the bug. Turn out ...
4 years, 6 months ago (2016-06-01 17:41:32 UTC) #20
Peter Kasting
On 2016/06/01 17:41:32, WC Leung wrote: > Anyway, we need some better fallback behavior for ...
4 years, 6 months ago (2016-06-01 17:49:19 UTC) #21
WC Leung
New patch uploaded. I'll try to create some Windows-only tests for the failure. No guarantee ...
4 years, 6 months ago (2016-06-01 18:56:56 UTC) #22
Peter Kasting
LGTM https://codereview.chromium.org/2021253002/diff/20001/chrome/browser/profiles/profile_manager.h File chrome/browser/profiles/profile_manager.h (right): https://codereview.chromium.org/2021253002/diff/20001/chrome/browser/profiles/profile_manager.h#newcode146 chrome/browser/profiles/profile_manager.h:146: // errors) are skipped. On 2016/06/01 18:56:55, WC ...
4 years, 6 months ago (2016-06-01 19:36:17 UTC) #23
WC Leung
New patch with test uploaded. Anthony and Peter Kasting: PTAL. brettw@: Need your opinion: the ...
4 years, 6 months ago (2016-06-03 20:08:42 UTC) #25
anthonyvd
Still LGTM % that browser test (It looks good but I'm not familiar enough with ...
4 years, 6 months ago (2016-06-03 20:22:29 UTC) #26
brettw
https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc File chrome/browser/profiles/profile_manager_browsertest.cc (right): https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc#newcode515 chrome/browser/profiles/profile_manager_browsertest.cc:515: bool AddAceToObjectsSecurityDescriptor(LPTSTR filename, LPTSTR trustee, I'm OK duplicating this ...
4 years, 6 months ago (2016-06-03 21:47:24 UTC) #27
Peter Kasting
https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc File chrome/browser/profiles/profile_manager_browsertest.cc (right): https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc#newcode47 chrome/browser/profiles/profile_manager_browsertest.cc:47: #endif Nit: There's a lot of stuff in this ...
4 years, 6 months ago (2016-06-04 01:24:25 UTC) #28
WC Leung
Thank you for your review. It's time to me to report the bug in the ...
4 years, 6 months ago (2016-06-04 04:55:22 UTC) #29
Peter Kasting
https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc File chrome/browser/profiles/profile_manager_browsertest.cc (right): https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc#newcode568 chrome/browser/profiles/profile_manager_browsertest.cc:568: // Tests may be reported as PASS even if ...
4 years, 6 months ago (2016-06-04 08:01:39 UTC) #30
WC Leung
https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc File chrome/browser/profiles/profile_manager_browsertest.cc (right): https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc#newcode568 chrome/browser/profiles/profile_manager_browsertest.cc:568: // Tests may be reported as PASS even if ...
4 years, 6 months ago (2016-06-04 15:48:33 UTC) #33
WC Leung
New patch uploaded with AddAceToObjectsSecurityDescriptor removed and a few nits fixed. I'll move the test ...
4 years, 6 months ago (2016-06-04 17:34:44 UTC) #35
Peter Kasting
https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc File chrome/browser/profiles/profile_manager_browsertest.cc (right): https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc#newcode603 chrome/browser/profiles/profile_manager_browsertest.cc:603: }; On 2016/06/04 17:34:43, WC Leung wrote: > On ...
4 years, 6 months ago (2016-06-04 18:12:31 UTC) #36
WC Leung
https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc File chrome/browser/profiles/profile_manager_browsertest.cc (right): https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc#newcode603 chrome/browser/profiles/profile_manager_browsertest.cc:603: }; > > Unable to do this in test ...
4 years, 6 months ago (2016-06-05 03:04:48 UTC) #37
brettw
On 2016/06/04 15:48:33, WC Leung wrote: > https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc > File chrome/browser/profiles/profile_manager_browsertest.cc (right): > > https://codereview.chromium.org/2021253002/diff/100001/chrome/browser/profiles/profile_manager_browsertest.cc#newcode568 ...
4 years, 6 months ago (2016-06-05 19:41:23 UTC) #38
WC Leung
> You can't structure the tests this way which is why you're having all of ...
4 years, 6 months ago (2016-06-05 22:53:50 UTC) #39
WC Leung
> You can't structure the tests this way which is why you're having all of ...
4 years, 6 months ago (2016-06-05 22:53:55 UTC) #40
brettw
> For the rest of your claim, I need to produce a detailed read of ...
4 years, 6 months ago (2016-06-06 05:19:28 UTC) #41
WC Leung
On 2016/06/06 05:19:28, brettw wrote: > > For the rest of your claim, I need ...
4 years, 6 months ago (2016-06-06 07:45:27 UTC) #42
Peter Kasting
LGTM
4 years, 6 months ago (2016-06-08 23:17:09 UTC) #43
brettw
Probably other people's reviews are sufficient so I'll say LGTM to undo my previous message ...
4 years, 6 months ago (2016-06-09 22:26:47 UTC) #44
WC Leung
On 2016/06/09 22:26:47, brettw wrote: > Probably other people's reviews are sufficient so I'll say ...
4 years, 6 months ago (2016-06-09 23:01:05 UTC) #45
WC Leung
On 2016/06/09 22:26:47, brettw wrote: > Probably other people's reviews are sufficient so I'll say ...
4 years, 6 months ago (2016-06-09 23:01:07 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2021253002/160001
4 years, 6 months ago (2016-06-09 23:02:46 UTC) #49
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/227798)
4 years, 6 months ago (2016-06-10 00:50:33 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2021253002/160001
4 years, 6 months ago (2016-06-10 04:07:59 UTC) #53
commit-bot: I haz the power
Committed patchset #8 (id:160001)
4 years, 6 months ago (2016-06-10 04:49:41 UTC) #55
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/4552c5134b38e43f1169e10810820bd10e459aa4 Cr-Commit-Position: refs/heads/master@{#399102}
4 years, 6 months ago (2016-06-10 04:50:58 UTC) #57
WC Leung
Updated the descriptions. Step 5 of the test instructions was wrong. Sorry for that.
4 years, 6 months ago (2016-06-15 12:33:16 UTC) #59
WC Leung
4 years, 6 months ago (2016-06-20 07:49:29 UTC) #61
Message was sent while issue was closed.
On 2016/06/15 12:33:16, WC Leung wrote:
> Updated the descriptions. Step 5 of the test instructions was wrong. Sorry for
> that.

The update is bogus (terribly sorry for that). The original instruction is
correct.

Powered by Google App Engine
This is Rietveld 408576698