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

Issue 414503005: [Mac] Fix ProcessUtilTest.FDRemapping for 10.9 and later. (Closed)

Created:
6 years, 5 months ago by Scott Hess - ex-Googler
Modified:
6 years, 4 months ago
Reviewers:
Mark Mentovai
CC:
chromium-reviews, erikwright+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

[Mac] Fix ProcessUtilTest.FDRemapping for 10.9 and later. OSX 10.9 introduced a kernel facility which allows tagging file descriptors to prevent various operations unless the caller knows the key. libdispatch uses this facility to tag a file descriptor against close() or dup(), and this test does both. Unfortunately, the failure case is to raise a kernel exception and hang the child process rather than return an error code. This change addresses this by attempting to set a guard. If successful, the guard is removed and the caller can close the file descriptor as normal. If unsuccessful, either the file descriptor is not valid, or it is guarded and cannot be closed. Either way, it is skipped. The test still succeeds by counting the file descriptors which can be closed. BUG=338157 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=286037

Patch Set 1 #

Total comments: 8

Patch Set 2 : Responses to #2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -0 lines) Patch
M base/process/process_util_unittest.cc View 1 3 chunks +73 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Scott Hess - ex-Googler
Another option which works is to check the fstat() results for FIFO, which will be ...
6 years, 5 months ago (2014-07-24 17:58:17 UTC) #1
Mark Mentovai
I guess this is OK…in a test… https://codereview.chromium.org/414503005/diff/1/base/process/process_util_unittest.cc File base/process/process_util_unittest.cc (right): https://codereview.chromium.org/414503005/diff/1/base/process/process_util_unittest.cc#newcode514 base/process/process_util_unittest.cc:514: bool is_fd_unguarded(int ...
6 years, 5 months ago (2014-07-25 13:23:44 UTC) #2
Scott Hess - ex-Googler
On 2014/07/25 13:23:44, Mark Mentovai wrote: > I guess this is OK…in a test… Not ...
6 years, 4 months ago (2014-07-28 19:58:03 UTC) #3
Mark Mentovai
LGTM Well, it’s not so much that it looks “good,” but you get the idea…
6 years, 4 months ago (2014-07-28 20:15:03 UTC) #4
Scott Hess - ex-Googler
The CQ bit was checked by shess@chromium.org
6 years, 4 months ago (2014-07-28 20:15:54 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/shess@chromium.org/414503005/20001
6 years, 4 months ago (2014-07-28 20:35:58 UTC) #6
commit-bot: I haz the power
6 years, 4 months ago (2014-07-29 00:20:17 UTC) #7
Message was sent while issue was closed.
Change committed as 286037

Powered by Google App Engine
This is Rietveld 408576698