[PATCH] Cygwin: Only return true from try_to_debug() if we launched a JIT debugger

Christian Franke Christian.Franke@t-online.de
Sun May 18 13:32:25 GMT 2025


Takashi Yano wrote:
> On Sat, 17 May 2025 15:00:53 +0100
> Jon Turney wrote:
>
>> This fixes constantly replaying the exception if we have a segfault
>> while a debugger is already attached, e.g. stracing a segv, see:
>>
>> https://cygwin.com/pipermail/cygwin/2025-May/258144.html
>>
>> (I'm tempted to remove the 'debugging' static from exception::handle()
>> and everything associated with it, since replaying the exception the
>> next half a million times it's hit seems really weird)
>>
>> (This would seem to make try_to_debug() less useful, as it then does
>> nothing if you're just run under gdb, but it's what the code used to
>> do...)
> ...
>
> Otherwise, LGTM. Please push.
>

The patch fixes the problem. The infinite loop does not longer occur. If 
a signal handler is present, it works again if run from strace. Same if 
run from gdb.

-- 
Thanks,
Christian



More information about the Cygwin-patches mailing list