Hi,
SIGTRAP, is triggered when you set a breakpoint/watchpoint in your code.
One way of hitting it, is if you are stepping over a function tree with a breakpoint watchpoint somewhere inside of it.
The location of the trace shows that it is the function sigdelayed inside cygwin1.dll, not sure why cygwin.dll is reporting a break/watch point …
Could you please do a backtrace and show us the content?
Also try to set the SIGTRAP signal differently as by default behavior is to kill the process if not debugged.
$ handle SIGTRAP nostop ignore nopass noprint
The main difference here is the “nopass” so gdb does not pass the signal to the inferior and kill the process.
How often is that ?