New issue
Advanced search Search tips

Issue 719939 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 718734



Sign in to add a comment

Add CHECK for disallowing user profile construction before starting the session

Project Member Reported by emaxx@chromium.org, May 9 2017

Issue description

We should probably find a way to crash the browser when the profile is attempted to be created when the session start request wasn't issued for it.

This should provide a failfast exit for some of the recent bugs, like issue 698057 or (supposedly) issue 689206.

The CHECK would prevent running the browser in an unexpected environment (which may lead to, for instance, bypassing the managed policies). Also the CHECK should provide the stack traces which are more likely to point to the culprit code.
 

Comment 1 by emaxx@chromium.org, May 9 2017

Blocking: 718734

Comment 2 by emaxx@chromium.org, May 9 2017

I think I found a good place that has the knowledge about the started sessions - session_manager::SessionManager. Seems that this class is called early both on the normal login and on the restart-after-crash path.
I'll do a more extensive testing and then publish the CL.
Project Member

Comment 3 by bugdroid1@chromium.org, May 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f588c3bceb117e579068d1b4b3bb4153642d941d

commit f588c3bceb117e579068d1b4b3bb4153642d941d
Author: emaxx <emaxx@chromium.org>
Date: Wed May 10 11:14:56 2017

Add CHECK on session start for profile construction

Fail fast from the profile construction when it's triggered without
starting a session first.

Crashing the browser is arguably a worth thing to do, as it prevents
running the browser in unexpected environment (which may lead to, for
instance, bypassing the managed policies).

Also this CHECK should provide the stack traces which are more likely to
point to the culprit code (as opposed to crashing at some later point
asynchronously - like e.g. on the CHECK added at
https://crrev.com/2801993002).

BUG= 719939 
TEST=existing browser tests;
    manual tests: normal login; Guest login; restart-after-crash.

Review-Url: https://codereview.chromium.org/2868043002
Cr-Commit-Position: refs/heads/master@{#470524}

[modify] https://crrev.com/f588c3bceb117e579068d1b4b3bb4153642d941d/chrome/browser/profiles/profile_impl.cc
[modify] https://crrev.com/f588c3bceb117e579068d1b4b3bb4153642d941d/components/session_manager/core/session_manager.cc
[modify] https://crrev.com/f588c3bceb117e579068d1b4b3bb4153642d941d/components/session_manager/core/session_manager.h

Comment 4 by emaxx@chromium.org, May 11 2017

Components: UI>Browser>Profiles

Comment 5 by emaxx@chromium.org, May 12 2017

Status: Fixed (was: Started)
This change reached Canary (60.0.3096.0). So far no crashes are reported (which is probably good, as this should the exceptional cases only).
Will continue monitoring the crash reports.

Comment 6 by emaxx@chromium.org, May 13 2017

Labels: Merge-Request-59
Project Member

Comment 7 by sheriffbot@chromium.org, May 13 2017

Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 8 by bugdroid1@chromium.org, May 13 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4582fd82174a35a2cf098d6d9408a216d1f8b34b

commit 4582fd82174a35a2cf098d6d9408a216d1f8b34b
Author: Maksim Ivanov <emaxx@chromium.org>
Date: Sat May 13 17:54:09 2017

Add CHECK on session start for profile construction

Fail fast from the profile construction when it's triggered without
starting a session first.

Crashing the browser is arguably a worth thing to do, as it prevents
running the browser in unexpected environment (which may lead to, for
instance, bypassing the managed policies).

Also this CHECK should provide the stack traces which are more likely to
point to the culprit code (as opposed to crashing at some later point
asynchronously - like e.g. on the CHECK added at
https://crrev.com/2801993002).

BUG= 719939 
TEST=existing browser tests;
    manual tests: normal login; Guest login; restart-after-crash.

Review-Url: https://codereview.chromium.org/2868043002
Cr-Original-Commit-Position: refs/heads/master@{#470524}
Review-Url: https://codereview.chromium.org/2878233003 .
Cr-Commit-Position: refs/branch-heads/3071@{#544}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/4582fd82174a35a2cf098d6d9408a216d1f8b34b/chrome/browser/profiles/profile_impl.cc
[modify] https://crrev.com/4582fd82174a35a2cf098d6d9408a216d1f8b34b/components/session_manager/core/session_manager.cc
[modify] https://crrev.com/4582fd82174a35a2cf098d6d9408a216d1f8b34b/components/session_manager/core/session_manager.h

Comment 9 by dchan@chromium.org, Aug 1 2017

Labels: VerifyIn-61

Comment 10 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment