This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Ctrl-C interrupt problem.
On Wed, Nov 15, 2000 at 06:27:38AM -0500, Eli Zaretskii wrote:
>> From: Fabrice Gautier <Fabrice_Gautier@sdesigns.com>
>> Date: Tue, 14 Nov 2000 20:18:11 -0800
>>
>> Now I hve tried to do some test with natives cygwin programs. The very
>> simple sample below crashes in some circumstances with ctrl-C:
>>
>> First Ctrl-C - everything is fine:
>>
>> Program received signal SIGINT, Interrupt.
>> [Switching to thread 325.0x140]
>> 0x77f2b5b4 in ?? ()
>>
>>
>> Second Ctrl-C - bad karma:
>> (gdb) c
>> Continuing.
>> 0 [main] gdb 9049 handle_exceptions: Exception:
>> STATUS_ACCESS_VIOLATION
>> 669 [main] gdb 9049 stackdump: Dumping stack trace to gdb.exe.stackdump
>> Segmentation fault (core dumped)
>
>I don't know whether this is connected, but Ctrl-C gets some special
>handling from the NT DOS Box. I don't know the particulars (Microsoft
>won't distribute NTVDM as Free Software ;-), but it is a known problem
>that NTVDM crashes or silently swallows Ctrl-C presses in some cases.
>
>I don't know if this is relevant for native Win32 console applications
>such as GDB compiled with Cygwin.
gdb should be using the same signal semantics for cygwin as it does on
UNIX. I'm not aware of any problems handling CTRL-C in normal cygwin
processes but I have seen cases where gdb didn't want to wake up after
hitting a CTRL-C. This may be because WaitForDebugEvent is not
interruptible by a CTRL-C. I think that Keith Seitz made this call time
out some time ago to work around this fact, though.
If there is a problem, it needs to be debugged. If you debug gdb using
gdb you (Fabrice) should be able to figure out where the SIGSEGV is
coming from. That doesn't necessarily mean that it will be immediately
obvious how to fix it, of course, but at least you'll have more of a
clue as to where gdb is dying.
However, if you are going to be debugging gdb using, gdb, it makes sense
to rebuild a new windows version from CVS. The gdb released with cygwin
net release is somewhat out-of-date, right now.
cgf