Mail Archives: cygwin/2009/11/25/23:45:17
Yaakov (Cygwin/X) wrote:
> I came across this error with run when launched from the cmd prompt with
> an empty CYGWIN variable:
>
> 1 [main] xterm 1248 dtable::stdio_init: couldn't make stderr
> distinct from stdout
>
> If I set CYGWIN=tty then this does not occur. Is this expected?
Not by me. The relevant code in cygwin looks like this:
/* STD_ERROR_HANDLE has been observed to be the same as
STD_OUTPUT_HANDLE. We need separate handles (e.g. using pipes
to pass data from child to parent). */
/* CV 2008-10-17: Under debugger control, std fd's have been potentially
initialized in dtable::get_debugger_info (). In this case
init_std_file_from_handle is a no-op, so, even if out == err we don't
want to duplicate the handle since it will be unused. */
if (out == err && (!being_debugged () || !not_open (2)))
{
/* Since this code is not invoked for forked tasks, we don't have
to worry about the close-on-exec flag here. */
if (!DuplicateHandle (hMainProc, out, hMainProc, &err, 0, true,
DUPLICATE_SAME_ACCESS))
{
/* If that fails, do this as a fall back. */
err = out;
system_printf ("couldn't make stderr distinct from stdout");
}
}
So, uhm...DuplicateHandle failed? That seems...strange. Unless the
handle being duplicated is itself invalid. (e.g. both out and err are
== INVALID_HANDLE (but then, !not_open(2) should catch that!)
Maybe somebody else will have an A-HA! moment, but without actually
debugging it this one has me confused.
--
Chuck
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -