From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by sourceware.org (Postfix) with ESMTPS id 3A6EE385801B for ; Wed, 10 Nov 2021 10:34:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3A6EE385801B Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MtO4E-1mRSEW1bDS-00umcx for ; Wed, 10 Nov 2021 11:34:26 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id A416CA80DAB; Wed, 10 Nov 2021 11:34:25 +0100 (CET) Date: Wed, 10 Nov 2021 11:34:25 +0100 From: Corinna Vinschen To: cygwin-developers@cygwin.com Subject: Re: 3.3.0: Possible regression in cygwin DLL (Win10); fixed in snapshot Message-ID: Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com References: <20211105123950.b118a7f2ba38379764df4c12@nifty.ne.jp> <20211105170542.96ce6dd4ca32880ddfddd660@nifty.ne.jp> <20211106044116.698b465a5d8ed6ce2cc75c99@nifty.ne.jp> <2cfa5de7-3b95-9062-4572-f36d304bc916@cornell.edu> <20211106151047.4d8f626bd6ebe9e4d8017f3b@nifty.ne.jp> <20211110173003.88359e8482ffa8b8be326903@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211110173003.88359e8482ffa8b8be326903@nifty.ne.jp> X-Provags-ID: V03:K1:Z8maikFY72yHQYAoH2tuKgEoBfYxN2xQWvFaiDiw2qTKpZv4rlw G8UkRK2iClZQTySo1mb5OgaGKjdNdQkoBLa23vX6Dv2IIsZMX4fe3JaCqyi8/2H+YdEfL8A RJz/1y6Lc5BMq1IpAC+3r084q1zvWlt0h8XEk2/8gP4IiknDzIfUn2fWhxCNV4KYmdvgnD4 5WNBogEcWaoGSA8xTAeGg== X-UI-Out-Filterresults: notjunk:1;V03:K0:g+Byb5QSf24=:JVy+4LEu0InUF1nEDruRRZ ASTjdg1faWH/yEqIwhttS6zSbIw3Pp7jdWxwSHYRDm8n+okU42QAgOfx6KuyX5CKX0aRZYy65 6ZEhiEiJENxUV1fFqHbHs5jq9Je2W3jejmszcbzc0qoj7HfTQlGNPQAlJchKljqYnLrCesOrr 0F9QIhPY2Os7i1uTVBPi1w7mFxRYleQRJb+u2Pd2KA7WsRfKF276PanjqZe1CxAKjw1y4nYBi 0IYMBDH6zW2xuIX2W+d4I4vZeQAnAtn0wsdXKllpmRpcUc2lT+uwklBEMzS9p5pugdvaS2Cxh 6WGwqTrnWs86MyTGrSUC27okaLWoPiEHwSK/4QfapvusVp4Az65MOaQy5BtJdIsyYtp06KTA6 6vDrVyXWzL708jHrR5PMpFeMtnYNfxG4Pmn/P7hak2QuvgAJgkOJE9n1fOEfyYSvmg1el1dHf RDvCg0+1LyhRDGXnR1oTComd33fKror2dsP2JXkVaAa7fCUDD28tTOdSAh9fONpgvx/W+oD2Q 44+2nyp/WtjXfQ8SoeRFuf7Y2xpNKsueq6z5kkXaZSSYd+yaiO9bNuJcvn6UfQzm4Ti4z+a2P Lnarvh51of2DkXXRBawl2lFEhWYdxcvmPNIrb/cUlszaCRA2SCj9G6NzogvdBGy59nD/I3/lD ax70SJ4vY4lzAn1u8jSYboWmXO/aiPQstojSF5Inak3NKoNFX2LopVhTBN6jV6yl2tjEvCmBt UrR8n7NXO0+Z/vjn X-Spam-Status: No, score=-99.5 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP 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-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2021 10:34:29 -0000 On Nov 10 17:30, Takashi Yano wrote: > Hi Corinna, > > On Sat, 6 Nov 2021 12:42:46 +0100 > Corinna Vinschen wrote: > > On Nov 6 15:10, Takashi Yano wrote: > > > Unfortunately, these solutions do not resolve the issue > > > which is another issue with C# program: > > > https://cygwin.com/pipermail/cygwin/2021-March/247987.html > > > This still needs FILE_SYNCHRONOUS_IO_NONALERT flag. > > > > If we want to add FILE_SYNCHRONOUS_IO_NONALERT, this would have to be > > solved by running NtReadFile/NtWriteFile synchronously in a thread, > > started on every invocation of raw_read/raw_write. raw_read/raw_write > > would then call cygwait on the thread object. To break on signal or > > thread cancallation events, it would have to call CancelSynchronousIo. > > That's certainly doable. > > I tried to implement your idea, however, I noticed that > NtQueryObject(ObjectNameInformation) call in > get_query_hdl_per_process() is blocked while reading the > pipe if FIPE_SYNCHRONOUS_IO_NONALERT is set and pipe is > in blocking mode. > > So I would like to propose alternative implementation with > FILE_SYNCHRONOUS_IO_NONALERT being set. Please have a look > at attached patch. With this patch, pipe itself in read side > is always set to nonblocking mode and simulate the blocking > behaviour in raw_read(). This can eliminate creating thread > for reading as well as calling CancelSynchronousIo(). > > Note that setting FILE_SYNCHRONOUS_IO_NONALERT only for read > pipe seems to be enough for C# programs. > > What do you think of this implementation? Can you push this to the topic/pipe branch for playing? I updated the branch to current master. Thanks, Corinna