www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/02/20/02:34:19

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 51K7YIOS152183
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 51K7YIOS152183
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=U9ED4BIn
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACA553858428
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1740036856;
bh=Q8o1Zn4wHZn+rNJxlA/bkwr03qYkJfueLQ3AFsv0FsQ=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=U9ED4BInzxywal+OXExXiltrN9X4cHlkqeaqzIjsnjdzFKP4Ri1DxJXzLT25zi214
o4/geptnWnxdUeBHRTs2d7HmZuZLhUvvRHvypset56Tf7mXLuJknKxqYAD3WU1OZO2
hHf9wvDTcHet9QgCiXl/e2uG7bvXFnDpanxiaHJU=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED70D3858C66
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ED70D3858C66
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740036780; cv=none;
b=rkOmf5eCBJ6bkBkfkQiGbPOASu6bsjVSg38LWMdxuu6Bs8NfQFopeG+KguV1w65Swlln4UgrB+DVdkNOZ50Y2n8AufBv8OoFMWKiwAIZg0Bt4Fpy5NkqCoKisblMjsBGJKrdKQ5rL7RwO5KGnZe16bqnj/N5DxZUrY5TGO8RHwg=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1740036780; c=relaxed/simple;
bh=HKVyWwWQeQsofIqv2qAT5FS5CBKAuAix2EKBigpS7Bc=;
h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature;
b=EXEvs4aadfVj1xU5LEyR8i3BvdPHDY7FViv7g0duIJDKS+CnbwXu0uIcsSRg5UFEA0+OmzU5ZDxgPC6HKyLF02czYGi/Ng7BZ7tP2NZx4IDzjooUyEi4Q5lxRS46M2rdo820spkMW9DQE9I1rOMRKGKh1n1S3KL97eCXqtRtAmQ=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED70D3858C66
Date: Thu, 20 Feb 2025 16:32:55 +0900
To: cygwin AT cygwin DOT com
Subject: Re: [regression-3.6] Pipe between Cygwin and non Cygwin (CRT/URT)
randomly loses characters
Message-Id: <20250220163255.282edd4c925f15a73a40386b@nifty.ne.jp>
In-Reply-To: <20250219162341.6c907a00b9bd7b0ae6f78c93@nifty.ne.jp>
References: <CALXu0Ue6z-QgfG3o7waBQ=n17xhAQAAH_Lx+0tyXGsKzhLMmtg AT mail DOT gmail DOT com>
<20250219162341 DOT 6c907a00b9bd7b0ae6f78c93 AT nifty DOT ne DOT jp>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

This is a multi-part message in MIME format.

--Multipart=_Thu__20_Feb_2025_16_32_55_+0900_Ya2AD/68j64U8.qm
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Wed, 19 Feb 2025 16:23:41 +0900
Takashi Yano wrote:
> On Wed, 19 Feb 2025 07:59:00 +0100
> Cedric Blancher wrote:
> > Good morning!
> > 
> > Cygwin 3.6.0-0.374.g4dd859d01c22.x86_64 on Win10/AMD64/64bit:
> > 
> > Pipe between Cygwin and non Cygwin (CRT/URT) randomly loses
> > characters. We do not have a reproducer yet, but it is happening at
> > least hourly on our test machines. Sometimes we only get a single
> > character, and sometimes words are missing.
> > 
> > Typically it happens like this:
> > bash -c 'typeset bar="$( powershell -Command ...) ; echo "${bar}""',
> > where bar does not contain the full output
> 
> Please provide full command line that can reproduce your problem.
> I can not see any pipe in above command.
> 
> > Same happens with dash and ksh93.
> > 
> > This does not happen between Cygwin processes, i.e. if I compile a
> > program with UCRT and read from a Cygwin program it fails, and if I
> > compile the same sources against Cygwin and pipe it into a Cygwin
> > program it works.

I believe this issue is same as:
https://cygwin.com/pipermail/cygwin/2025-February/257400.html

I'm trying to reproduce the issue using the test case attached.
However, I still cannot.

Any additional information?

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

--Multipart=_Thu__20_Feb_2025_16_32_55_+0900_Ya2AD/68j64U8.qm
Content-Type: text/plain;
 name="reproducer.sh"
Content-Disposition: attachment;
 filename="reproducer.sh"
Content-Transfer-Encoding: 7bit

#!/bin/bash
cat > random1024.c <<EOF
#include <unistd.h>
#include <stdlib.h>
#include <time.h>

#define LEN 1024
int main()
{
	unsigned char buf[LEN];
	srand(time(NULL));
	for (int i=0; i<LEN; i++) {
		do {
			buf[i] = (int)((double)rand()/RAND_MAX * 256);
		} while (buf[i] == 0 || buf[i] == '\n');
	}
	write(1, buf, LEN);
	return 0;
}
EOF
x86_64-w64-mingw32-gcc random1024.c -o random1024
while true; do
	a=$(./random1024)
	if [ $(/usr/bin/echo -n "$a" | wc -c) -ne 1024 ]; then
		break;
	fi
done
/usr/bin/echo -n "$a" | xxd
/usr/bin/echo -n "$a" | wc -c

--Multipart=_Thu__20_Feb_2025_16_32_55_+0900_Ya2AD/68j64U8.qm
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

--Multipart=_Thu__20_Feb_2025_16_32_55_+0900_Ya2AD/68j64U8.qm--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019