Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(9)

Issue 132220044: code review 132220044: os/exec: Do not assume process is done after Wait() returns.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 11 months ago by dparker
Modified:
10 years, 7 months ago
Reviewers:
CC:
golang-codereviews, iant
Visibility:
Public.

Description

os/exec: Do not assume process is done after Wait() returns. Currently the Wait() implementation assumes that once the Wait4() syscall returns, the process has exited. This may not always be the case, and this assumption prevents the process from being killed by `proc.Kill()`. In situations such as a process tracing another process using the Ptrace() family of syscalls, Wait() may be called several times during the life of the traced process. It is not safe to assume that the process has exited. This assumption must be validated before calling `p.setDone()`.

Patch Set 1 #

Patch Set 2 : diff -r 42bcf6ae4aff https://code.google.com/p/go #

Patch Set 3 : diff -r 42bcf6ae4aff https://code.google.com/p/go #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -3 lines) Patch
A src/pkg/os/exec/exec_unix_test.go View 1 chunk +36 lines, -0 lines 3 comments Download
M src/pkg/os/exec_unix.go View 1 chunk +6 lines, -3 lines 0 comments Download

Messages

Total messages: 5
dparker
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
10 years, 11 months ago (2014-08-27 00:07:10 UTC) #1
iant
Ideally the first line of the description should be os/exec: do not assume process is ...
10 years, 11 months ago (2014-08-27 21:54:30 UTC) #2
iant
https://codereview.appspot.com/132220044/diff/40001/src/pkg/os/exec/exec_unix_test.go File src/pkg/os/exec/exec_unix_test.go (right): https://codereview.appspot.com/132220044/diff/40001/src/pkg/os/exec/exec_unix_test.go#newcode9 src/pkg/os/exec/exec_unix_test.go:9: cmd := helperCommand(t, "sleep", "10") Don't you need to ...
10 years, 11 months ago (2014-08-27 22:02:01 UTC) #3
dparker
On 2014/08/27 22:02:01, iant wrote: > https://codereview.appspot.com/132220044/diff/40001/src/pkg/os/exec/exec_unix_test.go > File src/pkg/os/exec/exec_unix_test.go (right): > > https://codereview.appspot.com/132220044/diff/40001/src/pkg/os/exec/exec_unix_test.go#newcode9 > ...
10 years, 11 months ago (2014-08-28 01:29:11 UTC) #4
gobot
10 years, 7 months ago (2014-12-19 05:12:14 UTC) #5
R=close

To the author of this CL:

The Go project has moved to Gerrit Code Review.

If this CL should be continued, please see the latest version of
https://golang.org/doc/contribute.html for instructions on
how to set up Git and the Go project's Gerrit codereview plugin,
and then create a new change with your current code.

If there has been discussion on this CL, please give a link to it
(golang.org/cl/132220044 is best) in the description in your
new CL.

Thanks very much.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b