Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safety docs about process::Child going out of scope #31327

Merged
merged 2 commits into from
Feb 2, 2016

Conversation

dirk
Copy link
Contributor

@dirk dirk commented Jan 31, 2016

Drop is not implemented for Child, so if it goes out of scope in Rust-land and gets deallocated the child process will continue to exist and execute. If users want a guarantee that the process has finished running and exited they must manually use kill, wait, or wait_with_output.

Fixes #31289.

r? @steveklabnik

There is no `Drop` implemented for `Child`, so if it goes out
of scope in Rust-land and gets deallocated, the child process
will continue to exist and execute. If users want a guarantee
that the process has finished running and exited they must
manually use `kill`, `wait`, or `wait_with_output`.

Fixes rust-lang#31289.
@@ -47,6 +47,14 @@ use thread::{self, JoinHandle};
///
/// assert!(ecode.success());
/// ```
///
/// # Safety
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK the "Safety" heading is for memory safety and memory safety only. Also AFAIK a child process terminating later than expected is not a memory safety hazard. If I'm correct about both things, this heading should be renamed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkruppe: Was wondering about that myself. Any suggestions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Note is usually used for this kind of thing I believe.

@dirk dirk force-pushed the dirk/process-child-safety-docs branch from 6c730da to 7683922 Compare February 1, 2016 04:51
@steveklabnik
Copy link
Member

re-queueing travis. The structure and format look right to me, but r? @alexcrichton because I don't know enough about the accuracy here.

@alexcrichton
Copy link
Member

@bors: r+ 7683922 rollup

Thanks!

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Feb 1, 2016
…, r=alexcrichton

`Drop` is not implemented for `Child`, so if it goes out of scope in Rust-land and gets deallocated the child process will continue to exist and execute. If users want a guarantee that the process has finished running and exited they must manually use `kill`, `wait`, or `wait_with_output`.

Fixes rust-lang#31289.

r? @steveklabnik
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Feb 2, 2016
…, r=alexcrichton

`Drop` is not implemented for `Child`, so if it goes out of scope in Rust-land and gets deallocated the child process will continue to exist and execute. If users want a guarantee that the process has finished running and exited they must manually use `kill`, `wait`, or `wait_with_output`.

Fixes rust-lang#31289.

r? @steveklabnik
bors added a commit that referenced this pull request Feb 2, 2016
@bors bors merged commit 7683922 into rust-lang:master Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants