-
Notifications
You must be signed in to change notification settings - Fork 13.4k
run-pass/issue-10626.rs goes nuts #10790
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
Comments
Hm, this would happen if the child doesn't see that it's a child ( Out of curiosity, does this modification to the program pass for you? use std::os;
use std::io::process;
fn main () {
let args = os::args();
if args.len() > 1 && args[1] == ~"child" {
for _ in range(0, 1000) {
error!("hello?");
}
for _ in range(0, 1000) {
println!("hello?");
}
}
let args = [~"child"];
let config = process::ProcessConfig {
program : args[0].as_slice(),
args : args,
env : None,
cwd : None,
io : []
};
let mut p = process::Process::new(config).unwrap();
println!("{}", p.wait());
} |
I get:
|
When I rename the |
I shouldn't code when I'm tired. When I rename the |
Oh sorry I didn't realize that things were getting shadowed. Can you print the contents of |
When I add a
|
I'm more interested in what the children are printing, you'll probably have to set it up such that they inherit the stdio/stderr file descriptors. |
BTW: I can confirm that the issue is also there on a clean master (commit 693ec73). |
After some IRC discussion the conclusion was that it needs more investigation. Here's the code to see what the children print out. I've commented the original use std::os;
use std::io::process;
use std::io::process::InheritFd;
fn main () {
println!("args: {:?}", os::args());
let args = os::args();
if args.len() > 1 && args[1] == ~"child" {
//for _ in range(0, 1000) {
// error!("hello?");
//}
//for _ in range(0, 1000) {
// println!("hello?");
//}
}
let io = [InheritFd(0), InheritFd(1), InheritFd(2)];
let config = process::ProcessConfig {
program : args[0].as_slice(),
args : [~"child"],
env : None,
cwd : None,
io : io
};
let mut p = process::Process::new(config).unwrap();
println!("{}", p.wait());
} The output for every child is then:
I'm on Debian testing 64-bit. |
Looks to me like the test just needs to put the rest of its body in an else branch, like this:
|
I'm... not sure how I didn't see that before. I'm also not entirely sure how this is passing at all today. Regardless, thanks @dwrensha! |
Note entirely sure how this is passing at all today, but regardless this fixes the problems seen in rust-lang#10790
I can confirm that #10794 fixes this issue. |
On my machine the run-pass/issue-10626.rs goes nuts. It takes all my memory (8GB RAM, with a few things running, but not really much) and then started to swap (another 8GB then my disk was full).
When I
ps aux
I can see more and more processes calledx86_64-unknown-linux-gnu/test/run-pass/issue-10626.stage2-x86_64-unknown-linux-gnu
spinning up. The highest number I saw before it got very unresponsive was around 2800 processes.All this was a
make check
on a recent master69186efc199d48afca9427e448363212b0a59454
. I had one of my own commits on top of that, but I really don't think that commit can cause this issue (I currently rerun with a clean master though).The text was updated successfully, but these errors were encountered: