delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/03/22/06:19:20

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 309BF3857823
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-06.nifty.com 22MAI74V015371
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp;
s=dec2015msa; t=1647944287;
bh=tvqoPlmIXcdyfZubPBNZiQbu1BBr1TzC5LdxHEDc6T8=;
h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
b=f2y3aZuO9vBDG4LVlTtt9z/ncDXB9kQRkWYZIwabZNsVarrUKUKLtjbGfvHFJ1rry
u5zkag2301Cnr6xDTEZ+N/h14L3rhik0WSp9fgYnR/EF2psoKEm6xfT49DkBec1ijV
oEAIuaY2LxiMUmfACUma+wvyyzCfk5s9nr4YTRNE4zGaqyIcdJ6zxGfJ6A0Bo3P7Ku
ZeDzq6stbtVhCjrYvUseixR6Gu49X4wGE+ka6ld253tQBh4sp0HB3xe52QXVI/5v0j
ilMZyR2Nk22GraYWdJd+LYn8/DyatovORap6qWdSCpAsn4oTVdKbKpeB5De8+vnET+
Zv9/uSBasYqAA==
X-Nifty-SrcIP: [119.150.36.16]
Date: Tue, 22 Mar 2022 19:18:07 +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: <20220322191807.8348f074683c127b1723c5c2@nifty.ne.jp>
In-Reply-To: <alpine.BSO.2.21.2203211141320.56460@resin.csoft.net>
References: <alpine DOT BSO DOT 2 DOT 21 DOT 2203211141320 DOT 56460 AT resin DOT csoft DOT net>
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 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?

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