From: "chris.hardison@yahoo.com" <chris.hardison@yahoo.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: Hanging cygwin processes in Windows Server 2019
Date: Tue, 19 Oct 2021 17:56:12 +0000 (UTC) [thread overview]
Message-ID: <1673936147.4682792.1634666172598@mail.yahoo.com> (raw)
In-Reply-To: <cfe6d4b7-fdac-6618-505a-2f21439598fd@SystematicSw.ab.ca>
Brian,
Thanks for the feedback. I came across stdbuf earlier today and thought for sure that was the answer but when I showed it to my co-worker he said 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 = `type \\cygwin\\tmp\\${PID}.out && del \\cygwin\\tmp\\${PID}.out`);
I'm still hoping for a better solution.
Thanks!
chris
On Tuesday, October 19, 2021, 12:11:42 PM EDT, Brian Inglis <brian.inglis@systematicsw.ab.ca> wrote:
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. The simplest example is a call to
\cygwin\bin\ps from powershell. That normally returns with sub-second
response time. Once the problem occurs that call to \cygwin\bin\ps will
often take several minutes to return. 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 = `/cygwin/bin/ps -W`);TO
> chomp(@output = `/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
character buffered from the terminal but block buffered when used with
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.
--
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.]
--
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
next prev parent reply other threads:[~2021-10-19 17:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <764795149.682120.1633022545890.ref@mail.yahoo.com>
2021-09-30 17:22 ` chris.hardison
2021-10-01 16:23 ` Ken Brown
2021-10-02 0:04 ` Takashi Yano
2021-10-18 12:01 ` chris.hardison
2021-10-19 16:11 ` Brian Inglis
2021-10-19 17:56 ` chris.hardison [this message]
2021-10-19 19:23 ` Brian Inglis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1673936147.4682792.1634666172598@mail.yahoo.com \
--to=chris.hardison@yahoo.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).