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

Issue 2642483002: Relax ScopedFD close() error checking (Closed)

Created:
3 years, 11 months ago by spang
Modified:
3 years, 11 months ago
Reviewers:
Robert Sesek, Nico, davidben
CC:
chromium-reviews, vmpstr+watch_chromium.org, jln (very slow on Chromium)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Relax ScopedFD close() error checking This relaxes a check recently added to ScopedFDCloseTraits::Free to catch double closes, which can be detected by checking for failures of close() with errno of EBADF. Unfortunately, some Linux drivers can return errors from close() other than EBADF, but this does not indicate a failure to actually close the file descriptor. Since r401427, such errors will cause a crash (e.g. when unplugging your keyboard on Chrome OS - see crbug.com/681865). Relax the check to only check for EBADF since this is the only status that indicates a serious programming error. BUG=660960 Review-Url: https://codereview.chromium.org/2642483002 Cr-Commit-Position: refs/heads/master@{#446119} Committed: https://chromium.googlesource.com/chromium/src/+/b639e1d8775caaf587b58c0ff646c22a17a9aeef

Patch Set 1 #

Total comments: 2

Patch Set 2 : rm base::debug::Alias #

Patch Set 3 : linux only #

Total comments: 1

Patch Set 4 : ret != 0 #

Patch Set 5 : add back alias and todo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -0 lines) Patch
M base/files/scoped_file.cc View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (8 generated)
spang
3 years, 11 months ago (2017-01-17 21:54:26 UTC) #2
davidben
lgtm, though Nico and Robert should probably weigh in too. On the Linux side, here's ...
3 years, 11 months ago (2017-01-17 22:22:35 UTC) #3
Robert Sesek
https://codereview.chromium.org/2642483002/diff/1/base/files/scoped_file.cc File base/files/scoped_file.cc (right): https://codereview.chromium.org/2642483002/diff/1/base/files/scoped_file.cc#newcode43 base/files/scoped_file.cc:43: PCHECK(0 == ret || close_errno != EBADF); Since this ...
3 years, 11 months ago (2017-01-18 03:54:41 UTC) #4
spang
On 2017/01/18 03:54:41, Robert Sesek wrote: > https://codereview.chromium.org/2642483002/diff/1/base/files/scoped_file.cc > File base/files/scoped_file.cc (right): > > https://codereview.chromium.org/2642483002/diff/1/base/files/scoped_file.cc#newcode43 ...
3 years, 11 months ago (2017-01-18 20:35:40 UTC) #6
davidben
https://codereview.chromium.org/2642483002/diff/40001/base/files/scoped_file.cc File base/files/scoped_file.cc (right): https://codereview.chromium.org/2642483002/diff/40001/base/files/scoped_file.cc#newcode36 base/files/scoped_file.cc:36: // returning some other error. Probably want to remove ...
3 years, 11 months ago (2017-01-18 20:38:26 UTC) #8
spang
On 2017/01/18 20:38:26, davidben wrote: > https://codereview.chromium.org/2642483002/diff/40001/base/files/scoped_file.cc > File base/files/scoped_file.cc (right): > > https://codereview.chromium.org/2642483002/diff/40001/base/files/scoped_file.cc#newcode36 > ...
3 years, 11 months ago (2017-01-18 20:57:00 UTC) #11
davidben
non-owner lgtm
3 years, 11 months ago (2017-01-18 21:09:04 UTC) #12
Robert Sesek
lgtm
3 years, 11 months ago (2017-01-19 20:45:33 UTC) #13
Nico
lgtm, though I wonder if a whitelist of allowed error codes might be better (e.g. ...
3 years, 11 months ago (2017-01-25 16:34:45 UTC) #14
spang
On 2017/01/25 16:34:45, Nico wrote: > lgtm, though I wonder if a whitelist of allowed ...
3 years, 11 months ago (2017-01-25 18:48:52 UTC) #15
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/2642483002/80001
3 years, 11 months ago (2017-01-25 18:50:30 UTC) #17
commit-bot: I haz the power
3 years, 11 months ago (2017-01-25 21:17:44 UTC) #20
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/b639e1d8775caaf587b58c0ff646...

Powered by Google App Engine
This is Rietveld 408576698