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

Issue 8659032: Fix memory leak in MacOS process handling. (Closed)

Created:
9 years ago by Mads Ager (google)
Modified:
9 years ago
Reviewers:
Søren Gjesse
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix memory leak in MacOS process handling. Report error for failing writes. We used to enter a poll loop because we kept on attempting to write. Currently the error handling in the socket interface is inconsistent. We have a big TODO item on general error handling including the socket interface. R=sgjesse@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=1887

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -51 lines) Patch
M runtime/bin/eventhandler_macos.cc View 1 chunk +1 line, -3 lines 0 comments Download
M runtime/bin/eventhandler_win.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/bin/process_linux.cc View 1 3 chunks +29 lines, -17 lines 0 comments Download
M runtime/bin/process_macos.cc View 1 4 chunks +31 lines, -20 lines 0 comments Download
M runtime/bin/socket.cc View 2 chunks +0 lines, -5 lines 0 comments Download
M runtime/bin/socket.dart View 1 chunk +1 line, -2 lines 0 comments Download
M runtime/bin/socket_impl.dart View 3 chunks +20 lines, -2 lines 0 comments Download
M runtime/bin/socket_linux.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M runtime/bin/socket_macos.cc View 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (google)
9 years ago (2011-11-29 09:30:34 UTC) #1
Søren Gjesse
lgtm with comments http://codereview.chromium.org/8659032/diff/1/runtime/bin/process_linux.cc File runtime/bin/process_linux.cc (right): http://codereview.chromium.org/8659032/diff/1/runtime/bin/process_linux.cc#newcode233 runtime/bin/process_linux.cc:233: if (dup2(write_out[0], STDIN_FILENO) == -1) { ...
9 years ago (2011-11-29 09:39:25 UTC) #2
Mads Ager (google)
9 years ago (2011-11-29 10:10:13 UTC) #3
http://codereview.chromium.org/8659032/diff/1/runtime/bin/process_linux.cc
File runtime/bin/process_linux.cc (right):

http://codereview.chromium.org/8659032/diff/1/runtime/bin/process_linux.cc#ne...
runtime/bin/process_linux.cc:233: if (dup2(write_out[0], STDIN_FILENO) == -1) {
On 2011/11/29 09:39:25, Søren Gjesse wrote:
> As this is in the child process the output of these perror calls will not be
> visible anywhere.
> 
> We should probably write something to the exec_control[1] file descriptor as
> below and exit the child process.

Yes, refactored the code after execvp into a ReportChildError helper and called
it from each of these.

http://codereview.chromium.org/8659032/diff/1/runtime/bin/process_macos.cc
File runtime/bin/process_macos.cc (right):

http://codereview.chromium.org/8659032/diff/1/runtime/bin/process_macos.cc#ne...
runtime/bin/process_macos.cc:233: if (dup2(write_out[0], STDIN_FILENO) == -1) {
On 2011/11/29 09:39:25, Søren Gjesse wrote:
> Ditto.

Done.

Powered by Google App Engine
This is Rietveld 408576698