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

Issue 1984263002: process_singleton_posix: Remove the singleton lock file is not a symlink

Created:
4 years, 7 months ago by mario.endlessm
Modified:
4 years, 7 months ago
Reviewers:
eroman, mattm
CC:
chromium-reviews, Lei Zhang
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

process_singleton_posix: Remove the singleton lock file is not a symlink The singleton lock file is meant to be used to check when another instance of chromium is already running, so that a second instance being spawn can detect that situation and send the needed data to the original browser before exiting. For that reason, the singleton lock file is implemented as a symlink that encodes the hostname and the PID for the original instance as the (non-existent) target, which is information that will be checked on startup, automatically removing the lock file if needed (e.g. original PID no longer valid, wrong hostname...). However, one case that is not contemplated is whether the singleton lock file is something else other than a symlink, which will be identied by ParseLockPath as a "no lock present" situation without deleting the non-symlink file, and therefore causing chromium to fail once it tries to create the lock later on during startup. To prevent against this (unlikely, but possible) scenario, simply add some extra check to ParseLockPath to make sure that only symlinks are allowed for the lock file, and that anything else will be deleted before returning false ("no lock"). BUG=612453 R=eroman@chromium.org

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -0 lines) Patch
M chrome/browser/process_singleton_posix.cc View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
mario.endlessm
Initial patch proposed, let me know what you think. Thanks!
4 years, 7 months ago (2016-05-17 14:57:53 UTC) #1
Lei Zhang
+mattm
4 years, 7 months ago (2016-05-17 17:53:41 UTC) #5
eroman
This doesn't look right to me, but will defer to someone more knowledgeable about the ...
4 years, 7 months ago (2016-05-17 18:13:13 UTC) #7
mattm
On 2016/05/17 18:13:13, eroman wrote: > This doesn't look right to me, but will defer ...
4 years, 7 months ago (2016-05-17 18:21:57 UTC) #8
mario.endlessm
Hi, thanks a lot for the quick reply, let me answer these points inline below... ...
4 years, 7 months ago (2016-05-18 10:15:07 UTC) #9
mario.endlessm
On 2016/05/17 18:21:57, mattm wrote: > [...] > I'm also feeling negative on this. Aside ...
4 years, 7 months ago (2016-05-18 10:21:56 UTC) #10
eroman
Thanks Mario, I appreciate that you are trying to fix a problem for your user! ...
4 years, 7 months ago (2016-05-18 19:44:30 UTC) #11
mario.endlessm
4 years, 7 months ago (2016-05-19 09:27:32 UTC) #12
On 2016/05/18 19:44:30, eroman wrote:
> Thanks Mario, I appreciate that you are trying to fix a problem for your user!
> 
> My suggestion for moving forward is to gather more data on how often and why
> this happens, in order to better justify a solution.
> 
> If it is just a single user that encountered this once, for unknown reasons,
> that probably isn't going to meet our bar. And in fact that would also mean it
> won't be an ongoing issue for you to worry about ;)
> 
> If on the other hand this is something reproducible that is happening to other
> users, please add the data to the bug report.
> 
> Cheers.

Fair enough. I still think that a sanity check to make sure that
process_singleton_posix.cc meets the established contract would not hurt, but I
also see the point of not adding extra logic without proper justification, so
it's ok I gues.

I'll try to get a better understanding, if possible, of how on earth this
happened in the first place (since I can't really see how that could be either)
and post any update I might have here.

Thanks for taking your time to look into this in any case, much appreciated.

Powered by Google App Engine
This is Rietveld 408576698