From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by sourceware.org (Postfix) with ESMTPS id 8B2643858D28 for ; Wed, 10 Nov 2021 20:35:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8B2643858D28 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 (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mof1D-1mN5xb1PM9-00p400 for ; Wed, 10 Nov 2021 21:35:30 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id B7EEBA80A5B; Wed, 10 Nov 2021 21:35:29 +0100 (CET) Date: Wed, 10 Nov 2021 21:35:29 +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: <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> <20211110223049.b61c6cb87fb3e540b4214bcf@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211110223049.b61c6cb87fb3e540b4214bcf@nifty.ne.jp> X-Provags-ID: V03:K1:8Y3pZqW0qZFrahHN6b2z6e92ppqIYeBc8bSo+sS94QilK2yuEY2 PxUTzgKAVjxhqdk3ohMayDhSc2M04o4lSq5pQEqtJMqHud0fHlLnoPrbgEdqXx/u7zHvzLe eSoSdqexpBc9/JuE/VQHhlZ+hxGQ+yUSAqOsI9WDsTvfJuSN9I8tTxGKT91nd5QCiLvhBCF FWOKsm5qKoyaKTHXtTm8Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:B91LJDzrSXg=:cTO1IY6/hXjd5IbcpEb67L e93zrw1H430iAYYtarsUHD5XxbFsdtHggiIGVgXYHUUrS6uk4Icq0LqUhW2fGsjgOwOXD1X4D jrbOMJqPlBJHNonjG8oR5ovx7ZunmpUCfu8DIxvINc9itJQZNWwQdF+PTae0/Fh7v0VLS8NVu 0be75SamkLmtQ8ywuVEizVygwyUNpcOIF1mZYvn4gZgfhKVEMpkyLrmAVtLFP4AbQ8mTLsbOH XbVY6k2IwTRoJiLJTQxS/edzpGngkIMu13ekikFXZsW8jDWu2Zi1x6ZJhSHVtg1Cgpos/menw vyX+vhINjShc31wS3KV+gNV31yWzrw/MFfSLt5XlW65CYLUy/p5hsXuNy8btYpnFj8rLmjdS7 uxb7Wwz7YwgHhG7DGGsZJVtlTgPcT77HsC+o8zbqMJyuzDXn8yAPlUnIqTYz+2fpooVRlz4RC W22zBhJj1Vi3EsCJCeU9annxDcpQYD9qGHu9GS9VyHdPxaj6vZdnsahyy1lLnlZzti5V+ryKt UmtKFuzN8Rl8A89YwDbidHsQ3EWXP94W15gPdX76Q2OTorClHQhd2ow00MWeqLICoUHVDRjjK iHHw3Ti3bvqn4XWVdzlFkzTmOApRfABg9v3Wg5M3cTZlZwnOrmTO8cODnFwUgEmGMAwajFbN4 6++HH+NMYMJz6AkJQh9v2ulfKvupIvjjiCYSy8e4bw2wdfoSass9hbP3BaynpTXuu7ljU7+Gp SsGpzHvGVpOHvtgw X-Spam-Status: No, score=-99.1 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, 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 20:35:33 -0000 On Nov 10 22:30, Takashi Yano wrote: > On Wed, 10 Nov 2021 11:34:25 +0100 > Corinna Vinschen wrote: > > On Nov 10 17:30, Takashi Yano wrote: > > > 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. I have just pushed the experimental patch to topic/pipe. > Please try. If something wrong, please point it out. Great, I'll have a look. Ken, you're looking as well, right? Corinna