[PATCH v4] Cygwin: signal: Do not suspend myself and use VEH

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Jun 26 07:55:33 GMT 2025


Hi Takashi,

On Jun 26 15:20, Takashi Yano wrote:
> After the commit f305ca916ad2, some stress-ng tests fail in arm64
> windows. There seems to be two causes for this issue. One is that
> calling SuspendThread(GetCurrentThread()) may suspend myself in
> the kernel. Branching to sigdelayed in the kernel code does not
> work as expected as the original _cygtls::interrup_now() intended.
> The other cause is, single step exception sometimes does not trigger
> exception::handle() for some reason. Therefore, register vectored
> exception handler (VEH) and use it for single step exception instead.
> 
> Addresses: https://cygwin.com/pipermail/cygwin/2025-June/258332.html
> Fixes: f305ca916ad2 ("Cygwin: signal: Prevent unexpected crash on frequent SIGSEGV")
> Reported-by: Jeremy Drake <cygwin@jdrake.com>
> Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
> ---
>  winsup/cygwin/exceptions.cc           | 55 ++++++++++++++++++---------
>  winsup/cygwin/local_includes/cygtls.h |  1 +
>  winsup/cygwin/local_includes/ntdll.h  |  2 +
>  3 files changed, 40 insertions(+), 18 deletions(-)

Great, thanks, let's try this.  10 ms might be a bit short under load,
but we can always raise the value if push comes to shove.


Thanks,
Corinna


More information about the Cygwin-patches mailing list