]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: Remove waitloop argument from try_to_debug()
authorJon Turney <jon.turney@dronecode.org.uk>
Thu, 27 Aug 2020 15:12:47 +0000 (16:12 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Sun, 30 Aug 2020 15:24:47 +0000 (16:24 +0100)
commita30cd7a5b95675adf31b6092235b6c1f42c59520
tree6fb729859bd21521abd07ff4f1100461ce409eda
parent0416f68de186f3f24b1f8319e0781e6c5ae0ba53
Cygwin: Remove waitloop argument from try_to_debug()

Currently, when using CYGWIN's error_start facility, the faulting
process isn't stopped while the error_start process is started when the
fault is caused by an exception. (it even seems possible in theory that
the faulting process could have exited before the error_start process
attaches).

This leads to e.g. the core dump written by CYGWIN='error_start=dumper'
in response to an exception being non-deterministic.

Remove the waitloop argument from try_to_debug(), only used in the
exception case, so the faulting process busy-waits until the error_start
process attaches.

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

If error_start invokes something which doesn't attach using
DebugActiveProcess(), we will spin indefinitely, but that will also
currently occur for any of the existing other uses of try_to_debug(),
which default to waitloop=TRUE.
winsup/cygwin/exceptions.cc
winsup/cygwin/winsup.h
This page took 0.031524 seconds and 5 git commands to generate.