-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
6c730da
to
7683922
Compare
re-queueing travis. The structure and format look right to me, but r? @alexcrichton because I don't know enough about the accuracy here. |
…, 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
…, 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
Drop
is not implemented forChild
, 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 usekill
,wait
, orwait_with_output
.Fixes #31289.
r? @steveklabnik