Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-26 Thread Lasse Collin
On 2015-02-24 Corinna Vinschen wrote: > On Feb 24 16:16, Lasse Collin wrote: > > I'm going to release xz 5.2.1 in a day or two. Should that release > > have a workaround for this Cygwin bug? The workaround would avoid > > using O_NONBLOCK on stdout. It adds a race condition to signal > > handling i

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-24 Thread Corinna Vinschen
On Feb 24 16:16, Lasse Collin wrote: > On 2015-02-24 Corinna Vinschen wrote: > > On Feb 24 08:16, Thomas Wolff wrote: > > > Am 23.02.2015 um 13:23 schrieb Corinna Vinschen: > > > >On Feb 23 11:56, Corinna Vinschen wrote: > > > >>On Feb 22 22:07, Lasse Collin wrote: > > > >>>Alternative idea: Would

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-24 Thread Lasse Collin
On 2015-02-24 Corinna Vinschen wrote: > On Feb 24 08:16, Thomas Wolff wrote: > > Am 23.02.2015 um 13:23 schrieb Corinna Vinschen: > > >On Feb 23 11:56, Corinna Vinschen wrote: > > >>On Feb 22 22:07, Lasse Collin wrote: > > >>>Alternative idea: Would there be a significant downside if Cygwin > > >>>

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-24 Thread Corinna Vinschen
On Feb 24 08:16, Thomas Wolff wrote: > Lasse Collin had written. > >... the possibility of EINTR is mentioned for specific commands and F_SETFL > >isn't among them. > A subtle and maybe minor but valid objection. > > Am 23.02.2015 um 13:23 schrieb Corinna Vinschen: > >On Feb 23 11:56, Corinna Vin

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-23 Thread Thomas Wolff
Lasse Collin had written. ... the possibility of EINTR is mentioned for specific commands and F_SETFL isn't among them. A subtle and maybe minor but valid objection. Am 23.02.2015 um 13:23 schrieb Corinna Vinschen: On Feb 23 11:56, Corinna Vinschen wrote: On Feb 22 22:07, Lasse Collin wrote:

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-23 Thread Corinna Vinschen
On Feb 23 11:56, Corinna Vinschen wrote: > On Feb 22 22:07, Lasse Collin wrote: > > Eric Blake wrote: > > > On 02/20/2015 01:21 PM, Lasse Collin wrote: > > > > The above Cygwin behavior would make it very easy to add a > > > > workaround to xz for the pipe-data-loss problem: simply don't clear > >

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-23 Thread Corinna Vinschen
On Feb 22 22:07, Lasse Collin wrote: > Eric Blake wrote: > > On 02/20/2015 01:21 PM, Lasse Collin wrote: > > > The above Cygwin behavior would make it very easy to add a > > > workaround to xz for the pipe-data-loss problem: simply don't clear > > > O_NONBLOCK on stdout. However, I wonder if it is

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-23 Thread Corinna Vinschen
On Feb 21 18:44, Thomas Wolff wrote: > Am 20.02.2015 um 11:13 schrieb Corinna Vinschen: > >On Feb 20 08:56, Thomas Wolff wrote: > >>By flushing I meant actually waiting until it's been consumed at the > >>other end in this case, if that's technically feasible. > >You mean the actual act of changing

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-22 Thread Lasse Collin
(I have now subscribed to the list to get everyone's replies. Sorry for breaking the message thread.) Eric Blake wrote: > On 02/20/2015 01:21 PM, Lasse Collin wrote: > > The above Cygwin behavior would make it very easy to add a > > workaround to xz for the pipe-data-loss problem: simply don't cle

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-21 Thread Thomas Wolff
Am 20.02.2015 um 11:13 schrieb Corinna Vinschen: On Feb 20 08:56, Thomas Wolff wrote: Am 20.02.2015 um 00:47 schrieb Andrey Repin: Greetings, Thomas Wolff! Am 19.02.2015 um 10:51 schrieb Corinna Vinschen: On Feb 18 22:08, Lasse Collin wrote: (Please Cc me when replying, I'm not subscribed t

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-20 Thread Eric Blake
On 02/20/2015 01:21 PM, Lasse Collin wrote: > > For example, if xz is modified to leave O_NONBLOCK enabled on stdout, > > ( xz -dc smallfile.xz ; cat bigfile ) | ( sleep 1 ; wc -c ) > > will make cat print > > cat: write error: Resource temporarily unavailable > > on GNU/Linux and most

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-20 Thread Lasse Collin
On 2015-02-19 Corinna Vinschen wrote: > I can imagine. A few years back, when changing the pipe code to > using overlapped IO, we stumbled over a problem in Windows. When > closing an overlapped pipe while I/O is still ongoing, Windows > simply destroys the pipe buffers without flushing the data

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-20 Thread Corinna Vinschen
On Feb 20 08:56, Thomas Wolff wrote: > > Am 20.02.2015 um 00:47 schrieb Andrey Repin: > >Greetings, Thomas Wolff! > > > >>Am 19.02.2015 um 10:51 schrieb Corinna Vinschen: > >>>On Feb 18 22:08, Lasse Collin wrote: > (Please Cc me when replying, I'm not subscribed to the list.) > > Hi!

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-20 Thread Corinna Vinschen
On Feb 19 23:17, Thomas Wolff wrote: > Am 19.02.2015 um 10:51 schrieb Corinna Vinschen: > >On Feb 18 22:08, Lasse Collin wrote: > >>(Please Cc me when replying, I'm not subscribed to the list.) > >> > >>Hi! > >> > >>I suspect that there is a bug in Cygwin: > >> > >>1. Create a pipe with both ends i

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-19 Thread Thomas Wolff
Am 20.02.2015 um 00:47 schrieb Andrey Repin: Greetings, Thomas Wolff! Am 19.02.2015 um 10:51 schrieb Corinna Vinschen: On Feb 18 22:08, Lasse Collin wrote: (Please Cc me when replying, I'm not subscribed to the list.) Hi! I suspect that there is a bug in Cygwin: 1. Create a pipe with both

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-19 Thread Andrey Repin
Greetings, Thomas Wolff! > Am 19.02.2015 um 10:51 schrieb Corinna Vinschen: >> On Feb 18 22:08, Lasse Collin wrote: >>> (Please Cc me when replying, I'm not subscribed to the list.) >>> >>> Hi! >>> >>> I suspect that there is a bug in Cygwin: >>> >>> 1. Create a pipe with both ends in blocking mod

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-19 Thread Thomas Wolff
Am 19.02.2015 um 10:51 schrieb Corinna Vinschen: On Feb 18 22:08, Lasse Collin wrote: (Please Cc me when replying, I'm not subscribed to the list.) Hi! I suspect that there is a bug in Cygwin: 1. Create a pipe with both ends in blocking mode (O_NONBLOCK is not set). 2. The writer sets its

Re: Clearing O_NONBLOCK from a pipe may lose data

2015-02-19 Thread Corinna Vinschen
On Feb 18 22:08, Lasse Collin wrote: > (Please Cc me when replying, I'm not subscribed to the list.) > > Hi! > > I suspect that there is a bug in Cygwin: > > 1. Create a pipe with both ends in blocking mode (O_NONBLOCK >is not set). > 2. The writer sets its end to non-blocking mode. > 3. The

Clearing O_NONBLOCK from a pipe may lose data

2015-02-18 Thread Lasse Collin
(Please Cc me when replying, I'm not subscribed to the list.) Hi! I suspect that there is a bug in Cygwin: 1. Create a pipe with both ends in blocking mode (O_NONBLOCK is not set). 2. The writer sets its end to non-blocking mode. 3. The writer writes to the pipe. 4. The writer restores its en