From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic313-9.consmr.mail.ne1.yahoo.com (sonic313-9.consmr.mail.ne1.yahoo.com [66.163.185.32]) by sourceware.org (Postfix) with ESMTPS id C93CB3858C2C for ; Tue, 19 Oct 2021 17:56:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C93CB3858C2C X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634666175; bh=hJCr4fOlX5ELVhrtRWv8QxrqELiR+iSIPZtoROyk2Po=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=QEVAc+w2u6zTC8QhhCSzACBVGjvr6ymVWIkJkt980wb317p3K2TITBHYrjEzBNuI+b9WgxdGBodjQeohzwg5mavaXPki5A/voRj/X/Hgc5+YPvOMpAdcMRUjPrTm7htDoN3dzd5wVgdHuyIXTA2SO0q0IG1tJBJiHFZ1ryQPmwDfbQzSz6iqxoE9Tqcxiy6PzU7Hqj0mEPW8OH757G0d+4d0zpgVRExtyNDlhcjasUIic8h2+YJektGFyo9yK8FxzF/vefK1fc5MRnQkacNU8ia9L3HOlC9r10rE9suR3X2WTP16/W3bi3Z9WhskCFLfb+iyc+eGZPqda0DcVcgIDg== X-YMail-OSG: nV8Ty1QVM1mlF9QMdJiQrmiePKDqT.9cV8iqpNa9nvUVTnE7vugvlOou6XemQv5 d4A5DXV5cPjmseN6fnuhWXJLkGCFPZjw3qImIIGfd4vgAzhT8gcKs.GemoU1BeLBp.IcN1k8zJwO 95wB8CnAtfoQZuE1T4yazLs1KfIUIeaA7F1L5RPvDCmRek8dvAktfW9fQKw_aqPO8VsDb3AEsnz0 Gct_XgFcTgiVKjd0UhsA7qekQ7bDozHhe.w_wtmACdJf93S4m4o6ryj5K6XEi.KzvqWcghQBdhcF KZas5l1qFxhfOjY4M5GLwBrKXIujeljnqs0Pihn3GC6n6Uj1a2diOpTnqQZbeTiDGfAnRmE7eaN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Uy 9yQv68AUjQ64FKgDForLOxeYcxh1R36vKPmHyrWjEdqz2v7unRCpu_STxVc4zOiG0kebxpGyzHMA ROzlMAhJj.p20EHmoJ7ObwYtsv0aUWpBclAK.t4CLXkNlarWnNwIrR0wG0KtKhp04BpGa.V2f0Wp c8131XCMIeFhkl2NcyWpUFzyzn3KnuKvS5gahYRinbpfKqNjVvhFFwcKQ7UxC.pCCpXjTEX97jND ZrPTNSLnQVApuGlN0jIgD4ZTnv_FGgr4jG1Ils6oqLwZTLtwH82LWWkZHyblF.pazQqnMiWgSUSF 6NM7o.PE_zgH6flb1kk6ank86lQj5fSCqv4m_lD9uIVXJPYL7RhEiU.wH.tRO.tMq7ayVb1JaI1f QxoK7QUdNqFU6Kn3GIMGFD1o0EBCyuu_xBQDuYU72veo1TxNIoYP4XhEv7yV8o9qA0Aox51m_bQ6 bEeMXD2_8GzMy.KJQ.ysYmO5vdGw2fOQ9RHMpsNy89vezd5JMMLOpUQnpQT1mab4o8ZptfqjWfug E82zVxoLU9f71c_uZWDxAbpMAjn.ZTl9MHRrzNRuXMEM44AqkPM0O90tOBIVsH0Dn3tk996MMcfE 5eTBGYggHr9uc5zq7XRnNKv1.JicOXxo18vj6PHfDa9JniBkoEHEzLppah.fB0Ez77QCYno_paw. ._ibKXgIubh8ndXd6JiiOZk.1KFgdFvxVTr2rG3QlVS.Dw86DZdJgk81UEHTGEOaRBn1vYmbPZee CRWTvmpV3SSl9jwfzHoS5.gxF8vtqpgEHPjPvcNBpVu73LpPNdmYXb6cetgDF2xOjPlRODGhfqYY eRIghTskEKcWD2o0_buKB1AexnWcS.N5Azc.CqjptIsL1i5ZJuOhtRnkabcM80WT2xkVUc18- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Tue, 19 Oct 2021 17:56:15 +0000 Date: Tue, 19 Oct 2021 17:56:12 +0000 (UTC) From: "chris.hardison@yahoo.com" Reply-To: "chris.hardison@yahoo.com" To: "cygwin@cygwin.com" Message-ID: <1673936147.4682792.1634666172598@mail.yahoo.com> In-Reply-To: References: <764795149.682120.1633022545890.ref@mail.yahoo.com> <764795149.682120.1633022545890@mail.yahoo.com> <552722739.4126571.1634558495795@mail.yahoo.com> Subject: Re: Hanging cygwin processes in Windows Server 2019 MIME-Version: 1.0 X-Mailer: WebService/1.1.19116 YMailNorrin X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, REPTO_QUOTE_YAHOO, SCC_5_SHORT_WORD_LINES, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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, 19 Oct 2021 17:56:18 -0000 Brian, Thanks for the feedback.=C2=A0 I came across stdbuf earlier today and thoug= ht for sure that was the answer but when I showed it to my co-worker he sai= d he had already tied it with no luck, both with -i0 -e0 -o0 and with -oL. Actually, what is working is:`\\cygwin\\bin\\mintty.exe -w hide /bin/dash -= c "/bin/ps -W > /tmp/${PID}.out"`; chomp(@output =3D `type \\cygwin\\tmp\\${PID}.out && del \\cygwin\\tmp\\${P= ID}.out`); I'm still hoping for a better solution. Thanks! chris On Tuesday, October 19, 2021, 12:11:42 PM EDT, Brian Inglis wrote: =20 =20 On 2021-10-18 06:01, chris.hardison wrote: > On Thursday, September 30, 2021, 01:26:37 PM EDT, chris.hardison wrote: >> My cygwin install looks good and things seem to work perfectly for some time (hours or days), then a cygwin process started by a windows process that is usually a child process of a windows service written in perl will hang and then most all other cygwin processes will hang or take a very long time to return.=C2=A0 The simplest example is a call to \cygwin\bin\ps from powershell. That normally returns with sub-second response time.=C2=A0 Once the problem occurs that call to \cygwin\bin\ps wi= ll often take several minutes to return.=C2=A0 I've found that killing all cygwin processes will temporarily resolve the problem. >> I've read about redirecting NUL to stdin when making the call to cygwin processes from windows and that didn't seem to help. >> I've tried "set-processmitigation -name \cygwin\bin\ps.exe >> -disable ForceRelocateImages" with no real benefit. >> I've also tried "\cygwin\bin\dash -c /bin/rebaseall" on startup before the sshd service starts and that didn't seem to help. >> Any suggestions on how to prevent this problem will be greatly appreciated. > The problem seems to be that my cygwin processes that are always the child or grandchild of a windows service use a console device that is block buffered rather than character buffered. So using mintty to start those processes forces character buffered which solves the problem. I'm looking for cleaner way to force character buffered IO. Here's an example of the change: > From > chomp(@output =3D `/cygwin/bin/ps -W`);TO > chomp(@output =3D `/cygwin/bin/mintty.exe -w hide /bin/dash -c "/bin/ps -= W > /tmp/${PID}.out"; sleep 1; type /cygwin/tmp/${PID}.out; del /cygwin/tmp= /${PID}.out`); > Hopefully someone can suggest a simpler solution. Most Cygwin processes don't care about buffering, as they may be line or=20 character buffered from the terminal but block buffered when used with=20 pipe or file I/O. Try using stdbuf(1) instead of mintty to change buffering. You use it as a command prefix like nohup or time. Perl may also have ways of changing I/O buffering internally. --=20 Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.] --=20 Problem reports:=C2=A0 =C2=A0 =C2=A0 https://cygwin.com/problems.html FAQ:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 https://= cygwin.com/faq/ Documentation:=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://cygwin.com/docs.html Unsubscribe info:=C2=A0 =C2=A0 https://cygwin.com/ml/#unsubscribe-simple =20