delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/03/22/09:18:41

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ABBE63857C4A
Authentication-Results: sourceware.org;
dmarc=fail (p=none dis=none) header.from=nifty.ne.jp
Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 22MDHtiC018742
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp;
s=dec2015msa; t=1647955075;
bh=RkUu/gdr56rQlNV2ywOj8+tMoTYPdyYGszwm0aex0NY=;
h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
b=Ou10kZyRUMl2gdxKUkMlVc49rdGi0Y4IG8IDdCpwEcnoEUbYraZ/5xVkNLWrp2VGr
26wgzW3L1lwBBIyg3yhMX/prZoido2WV6IR5mpBvU2rpZXXmhxjRezOPxbaeehseaw
0xWcth8lD6M2d/oaL5NP48vFiXIowH4EfMgCrNFRTtwdxyvJ6AQxKDr/hB+opyCh2W
VON2NcSzn4Vk2NQf3dhnM9TyfUPJ0aXoPkgxcR5HU8UWBKHH18Qb61DHeFZF0SHnmU
1v33RgzL/m0SdMwy12P+wWKzk9VjCL0PAzc90nFRZ5Kayl3+dsB1b2fv2oX84b3xfl
cqJTR346avveQ==
X-Nifty-SrcIP: [119.150.36.16]
Date: Tue, 22 Mar 2022 22:17:56 +0900
From: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
To: cygwin AT cygwin DOT com
Subject: Re: pipe hang issue when running as SYSTEM
Message-Id: <20220322221756.2b7e80ec0a51e7ebd9df5a53@nifty.ne.jp>
In-Reply-To: <20220322191807.8348f074683c127b1723c5c2@nifty.ne.jp>
References: <alpine DOT BSO DOT 2 DOT 21 DOT 2203211141320 DOT 56460 AT resin DOT csoft DOT net>
<20220322191807 DOT 8348f074683c127b1723c5c2 AT nifty DOT ne DOT jp>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
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>
Cc: Jeremy Drake <cygwin AT jdrake DOT com>
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>

On Tue, 22 Mar 2022 19:18:07 +0900
Takashi Yano wrote:
> On Mon, 21 Mar 2022 11:45:57 -0700 (PDT)
> Jeremy Drake wrote:
> > This issue was reported to MSYS2 as a hang when trying to build libxml2 in
> > a Windows docker container.  Another user was able to come up with a
> > simple reproducer and a reasonable theory as to why it happens.  The msys2
> > issue is https://github.com/msys2/msys2-runtime/issues/77, and I will
> > quote the reproducer and analysis here:
> > 
> > I am having the same issue when building mingw. I managed to reduce the
> > issue to the following shell script:
> > 
> > #!/bin/sh
> > seq 1 99999 > big_file
> > eval '$(eval cmd.exe /c "type big_file" | : )'
> > 
> > When running as a normal user this completes immediately, but when run as
> > a system service it hangs forever. The issue appears to be that when
> > running under the SYSTEM account, the third sh process holds open the read
> > end of the pipe. Since cmd has too much output to write all at once, it
> > waits until the pipe's buffer has room to write more, but since sh isn't
> > actually reading from the pipe, this hangs forever. When running as a
> > normal user the read end of the pipe is not kept open, and so cmd.exe gets
> > an error when attempting to write and exits immediately.
> > 
> > My suspicion is that this is caused by f79a461 (which keeps the read end
> > of the pipe open) and b531d6b (which changes the behavior depending on
> > whether or not the program is running as a service).
> 
> Thanks for the report. This is expected problem as mentioned
> in b531d6b commit message. However, I could not imagin the
> situation that the service has multiple writer for the pipe
> and one of them is a non-cygwin app.
> 
> Question is: Does the docker invoke the command using SYSTEM
> account? Or is the processes in docker determined as running
> as a service?

I confirmed the processes in Windows docker are running as
well_known_service_sid. Let me consider a while.

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

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

- Raw text -


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