Change:
Scripts to reproduce Steps to reproduce: Output:  Backtrace: None Exit code: 141 Version:
What are you expecting to happen? When you send a TERM signal to a process without a registered handler, it terminates promptly. The runtime currently doesn't register any TERM/INT handlers, that's up to you.
I was expecting the runtime to return some upon requesting an action from a defunct process. I also tried polling the state of the defunct process using (as mentioned in the ), but this returned as well. Even if the runtime dosn't "catch" the SIG{TERM,INT}, is it not possible at all to or return in any of the two cases mentioned above?
Oh whoops, sorry! I had my understanding backwards, and apparently this isn't a bug on OSX which caused more confusion for me. Anyway, closing as a dupe of , it's the same cause.
Oh wow, I've done it again. I'm sorry, again! I apologize for not investigating more thoroughly. This is indeed separate from

Discussion:
// frames above our current position. let my_stack_bottom = my_stack_top + 20000 - OS_DEFAULT_STACK_ESTIMATE; <ins> // When using libgreen, one of the first things that we do is to turn off // the SIGPIPE signal (set it to ignore). By default, some platforms will // send a *signal* when a EPIPE error would otherwise be delivered. This // runtime doesn't install a SIGPIPE handler, causing it to kill the // program, which isn't exactly what we want! // // Hence, we set SIGPIPE to ignore when the program starts up in order to // prevent this problem. #[cfg(windows)] fn ignore_sigpipe() {} #[cfg(unix)] fn ignore_sigpipe() { use std::libc; use std::libc::funcs::posix01::signal::signal; unsafe { assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != -1); } } ignore_sigpipe(); </ins> rt::init(argc, argv); let mut exit_code = None; let mut main = Some(main);

} pub enum timezone {} <ins> pub type sighandler_t = size_t; </ins> } pub mod bsd44 { use libc::types::os::arch::c95::{c_char, c_int, c_uint};

} pub enum timezone {} <ins> pub type sighandler_t = size_t; </ins> } pub mod bsd44 {

use libc::types::os::arch::c95::{c_int, size_t}; pub static SIGTRAP : c_int = 5; <ins> pub static SIGPIPE: c_int = 13; pub static SIG_IGN: size_t = 1; </ins> pub static GLOB_ERR      : c_int = 1 << 0; pub static GLOB_MARK     : c_int = 1 << 1;

use libc::types::os::arch::c95::{c_int, size_t}; pub static SIGTRAP : c_int = 5; <ins> pub static SIGPIPE: c_int = 13; pub static SIG_IGN: size_t = 1; </ins> pub static GLOB_APPEND   : c_int = 0x0001; pub static GLOB_DOOFFS   : c_int = 0x0002;

} } <ins> pub mod signal { use libc::types::os::arch::c95::c_int; use libc::types::os::common::posix01::sighandler_t; #[cfg(not(target_os = "android"))] extern { pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; } #[cfg(target_os = "android")] extern { #[link_name = "bsd_signal"] pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; } } </ins> pub mod wait { use libc::types::os::arch::c95::{c_int}; use libc::types::os::arch::posix88::{pid_t};

<ins> // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // ignore-fast // Be sure that when a SIGPIPE would have been received that the entire process // doesn't die in a ball of fire, but rather it's gracefully handled. use std::os; use std::io::{PipeStream, Process}; fn test() { let os::Pipe { input, out } = os::pipe(); let input = PipeStream::open(input); let mut out = PipeStream::open(out); drop(input); let _ = out.write([1]); } fn main() { let args = os::args(); if args.len() > 1 && args[1].as_slice() == "test" { return test(); } let mut p = Process::new(args[0], [~"test"]).unwrap(); assert!(p.wait().success()); } </ins>