From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-03.nifty.com (conssluserg-03.nifty.com [210.131.2.82]) by sourceware.org (Postfix) with ESMTPS id ABBE63857C4A for ; Tue, 22 Mar 2022 13:18:18 +0000 (GMT) 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 Received: from Express5800-S70 (ak036016.dynamic.ppp.asahi-net.or.jp [119.150.36.16]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 22MDHtiC018742; Tue, 22 Mar 2022 22:17:55 +0900 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 To: cygwin@cygwin.com Cc: Jeremy Drake 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: <20220322191807.8348f074683c127b1723c5c2@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2022 13:18:24 -0000 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