public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* borgbackup test fail on cygwin (only) - cygwin pipe issues?
@ 2017-01-11  3:47 Thomas Waldmann
  2017-01-12 16:53 ` cyg Simple
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Waldmann @ 2017-01-11  3:47 UTC (permalink / raw)
  To: cygwin

Hi,

borgbackup uses a RPC protocol via a ssh pipe to implement client/server
communication.

borg client --pipe-- ssh --tcp-- sshd --pipe-- borg serve

This works very reliable, we have tests running on linux, freebsd,
netbsd, openbsd, OS X. It even works on win10 linux subsystem.

But on Cygwin, only the local tests work, but the remote tests (which
need the pictured ssh pipe) fail or hang.

When trying to find out what's going wrong, I noticed corrupted data
coming over the pipe.

I've found some other pipe issues on the cygwin mailing list, maybe this
is related?

Our issue about this:

https://github.com/borgbackup/borg/issues/1268

Note:

I am one of the borgbackup developers, but I am not a windows developer
(and I personally don't use windows or cygwin except for testing
borgbackup on this platform).

What I could offer is to run the tests on a fixed version.

Thanks for looking into this,

Thomas

--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: borgbackup test fail on cygwin (only) - cygwin pipe issues?
  2017-01-11  3:47 borgbackup test fail on cygwin (only) - cygwin pipe issues? Thomas Waldmann
@ 2017-01-12 16:53 ` cyg Simple
  2017-01-12 17:32   ` Thomas Waldmann
  2017-01-13 18:19   ` Thomas Waldmann
  0 siblings, 2 replies; 6+ messages in thread
From: cyg Simple @ 2017-01-12 16:53 UTC (permalink / raw)
  To: cygwin

On 1/10/2017 10:47 PM, Thomas Waldmann wrote:
> Hi,
> 
> borgbackup uses a RPC protocol via a ssh pipe to implement client/server
> communication.
> 
> borg client --pipe-- ssh --tcp-- sshd --pipe-- borg serve
> 
> This works very reliable, we have tests running on linux, freebsd,
> netbsd, openbsd, OS X. It even works on win10 linux subsystem.
> 
> But on Cygwin, only the local tests work, but the remote tests (which
> need the pictured ssh pipe) fail or hang.
> 
> When trying to find out what's going wrong, I noticed corrupted data
> coming over the pipe.
> 
> I've found some other pipe issues on the cygwin mailing list, maybe this
> is related?
> 
> Our issue about this:
> 
> https://github.com/borgbackup/borg/issues/1268
> 

Are your pipe handles in open in binary mode or text mode?  You should
always ensure they are in binary mode.

-- 
cyg Simple

--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: borgbackup test fail on cygwin (only) - cygwin pipe issues?
  2017-01-12 16:53 ` cyg Simple
@ 2017-01-12 17:32   ` Thomas Waldmann
  2017-01-13 18:19   ` Thomas Waldmann
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Waldmann @ 2017-01-12 17:32 UTC (permalink / raw)
  To: cygwin

>> https://github.com/borgbackup/borg/issues/1268
> 
> Are your pipe handles in open in binary mode or text mode?  You should
> always ensure they are in binary mode.

That was my first idea also.

https://github.com/borgbackup/borg/blob/1.0.9/borg/remote.py#L188 this
is the place where the ssh subprocess is forked and the pipes are set up.

There is nothing special about binary mode there, but as mentioned in
that ticket, I just tried it out to send binary data over such pipes and
it worked:

https://github.com/borgbackup/borg/issues/1268#issuecomment-239923192

(that \n should get modified to \r\n if in text mode, but it got through
"as is")


-- 

GPG ID: 9F88FB52FAF7B393
GPG FP: 6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393


--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: borgbackup test fail on cygwin (only) - cygwin pipe issues?
  2017-01-12 16:53 ` cyg Simple
  2017-01-12 17:32   ` Thomas Waldmann
@ 2017-01-13 18:19   ` Thomas Waldmann
  2017-01-13 19:08     ` Thomas Waldmann
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Waldmann @ 2017-01-13 18:19 UTC (permalink / raw)
  To: cygwin

It was a bug in our code that was triggered frequently by the small
cygwin pipe buffer size of only 64kiB.

borgbackup fix/workaround see there:

https://github.com/borgbackup/borg/pull/2032

It (almost?) never happened on other OSes, due to their bigger buffers.

Note:

It would be nice to have bigger pipe buffers on cygwin, for performance
reasons.


--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: borgbackup test fail on cygwin (only) - cygwin pipe issues?
  2017-01-13 18:19   ` Thomas Waldmann
@ 2017-01-13 19:08     ` Thomas Waldmann
  2017-01-14 15:38       ` Corinna Vinschen
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Waldmann @ 2017-01-13 19:08 UTC (permalink / raw)
  To: cygwin

On 01/13/2017 07:18 PM, Thomas Waldmann wrote:
> It was a bug in our code that was triggered frequently by the small
> cygwin pipe buffer size of only 64kiB.
> 
> borgbackup fix/workaround see there:
> 
> https://github.com/borgbackup/borg/pull/2032
> 
> It (almost?) never happened on other OSes, due to their bigger buffers.

Hmm, the last phrase seems not to be the real reason why it worked
there, but rather that neither Linux nor *BSD ever do partial writes on
blocking pipes.

So, should cygwin also behave that ^^^ way on blocking pipes?


--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: borgbackup test fail on cygwin (only) - cygwin pipe issues?
  2017-01-13 19:08     ` Thomas Waldmann
@ 2017-01-14 15:38       ` Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2017-01-14 15:38 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]

On Jan 13 20:07, Thomas Waldmann wrote:
> On 01/13/2017 07:18 PM, Thomas Waldmann wrote:
> > It was a bug in our code that was triggered frequently by the small
> > cygwin pipe buffer size of only 64kiB.
> > 
> > borgbackup fix/workaround see there:
> > 
> > https://github.com/borgbackup/borg/pull/2032
> > 
> > It (almost?) never happened on other OSes, due to their bigger buffers.
> 
> Hmm, the last phrase seems not to be the real reason why it worked
> there, but rather that neither Linux nor *BSD ever do partial writes on
> blocking pipes.
> 
> So, should cygwin also behave that ^^^ way on blocking pipes?

Yes.  I inspected the code and the current behaviout was apparently
an accident when refactoring the pipe write code.  I applied a patch
and uploaded new developer snapshots to https://cygwin.com/snapshots/
Please give them a try.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-14 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11  3:47 borgbackup test fail on cygwin (only) - cygwin pipe issues? Thomas Waldmann
2017-01-12 16:53 ` cyg Simple
2017-01-12 17:32   ` Thomas Waldmann
2017-01-13 18:19   ` Thomas Waldmann
2017-01-13 19:08     ` Thomas Waldmann
2017-01-14 15:38       ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).