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

Issue 8662006: Fix a number of issues with the process handling (Closed)

Created:
9 years, 1 month ago by Søren Gjesse
Modified:
9 years, 1 month ago
Reviewers:
Mads Ager (google)
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Fix a number of issues with the process handling 1. Ignore the signal SIGPIPE on Linux and Mac OS When reading from or writing to a closed pipe the signal SIGPIPE is raised. The default handling of this is to terminate the program. When signal SIGPIPE is ignored the read and write returns EPIPE. 2. Wrong return type for stdio getter 3. When there is an error on a socket mark it as closed 4. Mark the pipe used for process exit status as a one way pipe 5. Add tests to test stdin, stdout and stderr in Dart scripts R=ager@google.com BUG=dart:536, dart:454 TEST= Committed: https://code.google.com/p/dart/source/detail?r=1793

Patch Set 1 #

Patch Set 2 : Fix compile on Mac OS #

Patch Set 3 : Rebase #

Total comments: 11

Patch Set 4 : Addressed review comments from ager@ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+227 lines, -147 lines) Patch
M runtime/bin/builtin.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/eventhandler_linux.cc View 3 chunks +11 lines, -2 lines 0 comments Download
M runtime/bin/eventhandler_macos.cc View 2 chunks +10 lines, -2 lines 0 comments Download
M runtime/bin/main.cc View 2 chunks +6 lines, -0 lines 0 comments Download
M runtime/bin/platform.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/bin/platform_linux.cc View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
M runtime/bin/platform_macos.cc View 1 chunk +16 lines, -0 lines 0 comments Download
M runtime/bin/platform_win.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/bin/process_impl.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/process_linux.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/process_macos.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/socket.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/bin/socket_linux.cc View 1 2 3 1 chunk +5 lines, -6 lines 0 comments Download
M runtime/bin/socket_macos.cc View 1 chunk +5 lines, -6 lines 0 comments Download
M runtime/bin/socket_stream.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A tests/standalone/src/ProcessBrokenPipe.dart View 1 chunk +22 lines, -0 lines 0 comments Download
A tests/standalone/src/ProcessStdIOScript.dart View 1 chunk +22 lines, -0 lines 0 comments Download
M tests/standalone/src/ProcessStderrTest.dart View 1 chunk +38 lines, -46 lines 0 comments Download
M tests/standalone/src/ProcessStdoutTest.dart View 1 chunk +38 lines, -47 lines 0 comments Download
M tests/standalone/src/ProcessTestUtil.dart View 1 2 2 chunks +20 lines, -9 lines 0 comments Download
M tests/standalone/src/TestRunnerTest.dart View 1 2 3 3 chunks +2 lines, -23 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
9 years, 1 month ago (2011-11-23 11:39:07 UTC) #1
Mads Ager (google)
lgtm http://codereview.chromium.org/8662006/diff/4001/runtime/bin/eventhandler_linux.cc File runtime/bin/eventhandler_linux.cc (right): http://codereview.chromium.org/8662006/diff/4001/runtime/bin/eventhandler_linux.cc#newcode218 runtime/bin/eventhandler_linux.cc:218: printf("Poll events:\n"); Do you want to add this ...
9 years, 1 month ago (2011-11-23 12:45:19 UTC) #2
Søren Gjesse
9 years, 1 month ago (2011-11-23 14:50:18 UTC) #3
http://codereview.chromium.org/8662006/diff/4001/runtime/bin/eventhandler_lin...
File runtime/bin/eventhandler_linux.cc (right):

http://codereview.chromium.org/8662006/diff/4001/runtime/bin/eventhandler_lin...
runtime/bin/eventhandler_linux.cc:218: printf("Poll events:\n");
On 2011/11/23 12:45:19, Mads Ager wrote:
> Do you want to add this debugging line in the macos version as well?

Yes, to separate each return from poll.

http://codereview.chromium.org/8662006/diff/4001/runtime/bin/platform.h
File runtime/bin/platform.h (right):

http://codereview.chromium.org/8662006/diff/4001/runtime/bin/platform.h#newco...
runtime/bin/platform.h:14: 
On 2011/11/23 12:45:19, Mads Ager wrote:
> There is only one blank between methods in the rest of the file, remove one
> here?

Done.

http://codereview.chromium.org/8662006/diff/4001/runtime/bin/platform_linux.cc
File runtime/bin/platform_linux.cc (right):

http://codereview.chromium.org/8662006/diff/4001/runtime/bin/platform_linux.c...
runtime/bin/platform_linux.cc:20: perror("Setting signal handler failed");
On 2011/11/23 12:45:19, Mads Ager wrote:
> return false?

Absolutely.

http://codereview.chromium.org/8662006/diff/4001/runtime/bin/socket_linux.cc
File runtime/bin/socket_linux.cc (right):

http://codereview.chromium.org/8662006/diff/4001/runtime/bin/socket_linux.cc#...
runtime/bin/socket_linux.cc:70: intptr_t Socket::Write(intptr_t fd, const void*
buffer, intptr_t num_bytes) {
On 2011/11/23 12:45:19, Mads Ager wrote:
> You changed intptr_t to int in the interface?

Done.

http://codereview.chromium.org/8662006/diff/4001/tests/standalone/src/Process...
File tests/standalone/src/ProcessTestUtil.dart (right):

http://codereview.chromium.org/8662006/diff/4001/tests/standalone/src/Process...
tests/standalone/src/ProcessTestUtil.dart:25: String getDartFileName() {
On 2011/11/23 12:45:19, Mads Ager wrote:
> I think this code is in TestRunnerTest as well. Could you grep for
Release_ia32
> and see if we an have them all use this one?

Done.

Powered by Google App Engine
This is Rietveld 408576698