From: Jon Turney <jon.turney@dronecode.org.uk>
To: Cygwin Patches <cygwin-patches@cygwin.com>
Subject: Re: [PATCH] Cygwin: Remove waitloop argument from try_to_debug()
Date: Sun, 30 Aug 2020 16:00:20 +0100 [thread overview]
Message-ID: <c177f5c6-4fc3-cb98-5c35-2644ffa24ef3@dronecode.org.uk> (raw)
In-Reply-To: <20200830124700.GP3272@calimero.vinschen.de>
On 30/08/2020 13:47, Corinna Vinschen wrote:
> On Aug 29 15:43, Jon Turney wrote:
>> Currently, when using CYGWIN='error_start=dumper', the core dump written
>> in response to an exception is non-deterministic, as the faulting
>> process isn't stopped while the dumper is started (it even seems
>> possible in theory that the faulting process could have exited before
>> the dumper process attaches).
>>
>> Remove the waitloop argument, only used in this case, so the faulting
>> process busy-waits until the dump starts.
>>
>> Code archaeology to determine why the code is this way didn't really turn
>> up any answers, but this seems a low-risk change, as this only changes
>> the behaviour when:
>>
>> - a debugger isn't already attached
>> - an error_start is specified in CYGWIN env var
>> - an exception has occurred which will be translated to a signal
>>
>> Future work: This probably can be further simplified to make it
>> completely synchronous by waiting for the dumper process to exit. This
>> would avoid the race condition of the dumper attaching and detaching
>> before we get around to checking for that (which we try to work around
>> by juggling thread priorities), and the failure state where the dumper
>> doesn't attach and we spin indefinitely.
So, on reflection, this idea is wrong, and it currently is the way it
has to be.
If we use CYGWIN='error_start=gdb', we should be able to continue the
thread which encountered an exception, which we can't do if it's blocked
waiting for the error_start process to exit.
So I'll tweak the patch commentary before pushing.
prev parent reply other threads:[~2020-08-30 15:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-29 14:43 Jon Turney
2020-08-30 12:47 ` Corinna Vinschen
2020-08-30 15:00 ` Jon Turney [this message]
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=c177f5c6-4fc3-cb98-5c35-2644ffa24ef3@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=cygwin-patches@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).