I'm running another project which is based on Quark with newer version of Rust toolchain. The following lines in qvisor/src/runc/runtime/sandbox_process.rs crashes with the output fatal runtime error: IO Safety violation: owned file descriptor already closed:
unsafe {
let tty = slave.dup()?;
cmd.stdin(Stdio::from_raw_fd(tty));
cmd.stdout(Stdio::from_raw_fd(tty));
cmd.stderr(Stdio::from_raw_fd(tty));
}
I have changed them to the following lines to solve this problem:
unsafe {
let tty_file = File::from_raw_fd(slave.dup()?);
cmd.stdin(Stdio::from(tty_file.try_clone().map_err(|_| Error::SysError(-(errno::errno().0 as i32)))?));
cmd.stdout(Stdio::from(tty_file.try_clone().map_err(|_| Error::SysError(-(errno::errno().0 as i32)))?));
cmd.stderr(Stdio::from(tty_file));
}
I'm running another project which is based on Quark with newer version of Rust toolchain. The following lines in
qvisor/src/runc/runtime/sandbox_process.rscrashes with the outputfatal runtime error: IO Safety violation: owned file descriptor already closed:I have changed them to the following lines to solve this problem: