On 17.12.2012 21:22, Rich Felker wrote: > On Mon, Dec 17, 2012 at 11:58:29AM -0500, Rich Felker wrote: > To track this down, you could run under gdb and just interrupt the > program and look at a backtrace once it hangs. This should make it > clear whether exit was called recursively. > > Rich > Looks something like that (gdb output in the attached file, `bt` while `opt` hangs in the bottom): I've set `break exit` and stepped till it hangs, first exit() happens in command line parsing (https://github.com/llvm-mirror/llvm/blob/master/lib/Support/CommandLine.cpp#L846), which calls report_fatal_error("IO failure on output stream.");, which calls exit itself. Looks like (note that I'm barely know C/C++) something wrong in ostream destruction: after changing ifdef to ifndef @ https://github.com/llvm-mirror/llvm/blob/master/lib/Support/raw_ostream.cpp#L501 all works as it should: > ~ # /root/llvm-build/Release+Asserts/bin/opt --reject-this-option 2>&- > ~ # echo $? > 1 //wbr ojab