Ben Collins-Sussman <sussman@collab.net> writes:
> philip@tigris.org writes:
>
> > * subversion/libsvn_subr/io.c (svn_io_run_cmd): Remove the call to
> > apr_procattr_io_set to create pipes, we don't use them. They still
> > get created by apr_procattr_child_err_set et.al. but that's an APR
> > bug. Fix text of error messages.
>
> Philip,
>
> Ever since this change, I've been seeing funny output. Specifically,
> whenever we run 'patch' (which only happens during an textual merge
> during updates), I see things like:
>
> patching file `iota'
> Hunk #1 FAILED at 1.
> 1 out of 1 hunk FAILED -- saving rejects to iota.62892.00001.rej
> C ./iota
>
> Instead of the old days, where we simply saw:
>
> C ./iota
>
>
> Even when the merge is successful, I no longer just see 'G', but
> rather 'Hunk #1 succeeded', and then a 'G'.
>
> So somehow the patch process is dumping stdout to the screen. This is
> bad, because it's a subprocess of libsvn_wc. Do you have any idea
> what's going on here, or how to fix it?
Yes, I see. What is happening is that previously three pipes were
created connecting the child to the parent. These file descriptors
were then overwritten with any in/out/error files that were passed to
svn_io_run_cmd. After the exec they then got connected to the child's
stdin/stdout/stderr.
I assume patch is not passing an out file descriptor to
svn_io_run_cmd. Thus in the past when patch produced output it was
written to the pipe, but never read by the parent. The parent cannot
even get to the relevant pipe file descriptor.
Now the pipes are only created for those of in/out/err for which files
are passed, the child inherits its parents stdin/stdout/stderr for the
others. So this case the child's stdout is a duplicate of the parent's
and patch's output appears on the parent's stdout.
Two solutions:
- revert the patch and get the pipes back,
- connect a file to svn_io_run_cmd outfile to recieve patch's stdout
Reverting the patch is a short term solution, when/if APR is fixed
the problem may reappear (depending on how they fix it).
>
> (Another related mystery: why aren't tests like 'basic_tests.py 5',
> which tests merging, choking on the extra output lines?)
Don't know, I did run them before checking in the patch...
--
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:56 2006