cygrunsrv + sshd + rsync = 20 times too slow -- throttled?
Takashi Yano
takashi.yano@nifty.ne.jp
Sat Sep 18 08:03:32 GMT 2021
On Fri, 17 Sep 2021 22:10:39 -0400
Ken Brown wrote:
> On 9/17/2021 10:07 PM, Ken Brown wrote:
> > On 9/17/2021 9:30 PM, Takashi Yano wrote:
> >> On Fri, 17 Sep 2021 15:53:18 -0400
> >> Ken Brown wrote:
> >>> $ cygport *.cygport up
> >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe
> >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe
> >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe
> >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe
> >>> *** Info: Building native toolchain for x86_64-pc-cygwin host
> >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe
> >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe
> >>> >>> Uploading cygwin-3.3.0-0.1.9814cfd8f693.x86_64
> >>> [...]
> >>>
> >>> This happens in an xterm window, but not in mintty.
> >>
> >> I have installed cygwin 3.3.0 [TEST].
> >> And I tryed cygpoort upload, but I cannot reproduce your problem
> >> even in xterm window.
> >
> > Hmm. I wonder what's different about my environment that would explain this. I
> > start the X server with startxwin.
>
> And then I start UXTerm from the xwin-xdg-menu.
Ah, this seems to be the point.
If xterm is started from xwin-xdg-menu, minimized test case
(/bin/echo A; /bin/echo B) | head -1
also causes the error:
/bin/echo: write error: Broken pipe
Even in mintty, this error occurs if it is started from
xwin-xdg-menu.
I also confirmed that this also happen with cygwin 3.2.0.
However this does not happen if xterm is started from
mintty window by 'xterm -display :0'.
So, this is not a regression in cygwin 3.3.0 [TEST].
In other words, the change of pipe implementation is not
the culprit.
I have no idea why terminal behaves differently if it is
started from xwin-xdg-menu so far.
'yes |head -1' also behaves differently. In the termainl
not started from xwin-xdg-menu,
[yano@Express5800-S70 ~]$ yes |head -1
y
[yano@Express5800-S70 ~]$
however, if it is started from xwin-xdg-menu,
[yano@Express5800-S70 ~]$ yes |head -1
y
yes: standard output: Broken pipe
[yano@Express5800-S70 ~]$
It seems that SIGPIPE is handled differently. I guess
SIGPIPE is handled by SIG_IGN if the terminal started
from xwin-xdg-menu, otherwize, it is handled by SIG_DFL.
Ah, the following patch for xwin-xdg-menu may be the
right thing.
--- execute.c.orig 2021-06-23 23:59:37.000000000 +0900
+++ execute.c 2021-09-18 16:53:52.144248600 +0900
@@ -76,6 +76,7 @@
{
struct rlimit rl;
unsigned int fd;
+ int sig;
/* dup write end of pipes onto stderr and stdout */
close(STDOUT_FILENO);
@@ -89,6 +90,10 @@
for (fd = STDERR_FILENO + 1; fd < rl.rlim_cur; fd++)
close(fd);
+ /* Set all signal handlers to SIG_DFL. */
+ for (sig = 1; sig < NSIG; sig++)
+ signal(sig, SIG_DFL);
+
/* Disassociate any TTYs */
setsid();
--
Takashi Yano <takashi.yano@nifty.ne.jp>
More information about the Cygwin-developers
mailing list