CTRL-c kills all children of current parent process.

Volker Quetschke quetschke@scytek.de
Mon Dec 11 01:07:00 GMT 2006


I encountered the problem that a CTRL-c in a shell (tested with bash in
rxvt and in cmd.exe with/without CYGWIN=tty (Yes, before I started the
bash)) kills all children started by the running process even though
it has its own signal handler in place.

Take the attached source and compile it.
$ gcc breaktest.c -o breaktest.exe

Start it and press CTRL-c:
$ ./breaktest.exe
Started child pid: 372 from parent 3504
you have pressed ctrl-c
wait returned: 372
pid: 372 wid: 372
Done

Hmm, the CTRL-c kills the child and the parent returns because
the child finished.

Now start it again and send the SIGINT via `kill -INT <parentid>` from
another shell (3x in this example):

$ ./breaktest.exe
Started child pid: 2140 from parent 3608
you have pressed ctrl-c
you have pressed ctrl-c
you have pressed ctrl-c


That works as expected. So the question is, can killing the children
of a running process by CTRL-c be considered a bug?


    Volker


-- 
PGP/GPG key  (ID: 0x9F8A785D)  available  from  wwwkeys.de.pgp.net
key-fingerprint 550D F17E B082 A3E9 F913  9E53 3D35 C9BA 9F8A 785D
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: breaktest.c
URL: <http://cygwin.com/pipermail/cygwin/attachments/20061211/22ca375a/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 248 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20061211/22ca375a/attachment.sig>


More information about the Cygwin mailing list