delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/07/03:47:03

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <00dc01c19758$02b30f10$c51811ac@brokat.de>
From: "Michael Rumpf" <michael AT rumpfonline DOT de>
To: <cygwin AT cygwin DOT com>
References: <00f201c18922$2783b180$c51811ac AT brokat DOT de> <003c01c18936$55ca5fd0$c51811ac AT brokat DOT de> <05cb01c18a07$85d72c40$c51811ac AT brokat DOT de> <02f701c19516$5212afa0$c51811ac AT brokat DOT de> <20020104170443 DOT GD30445 AT redhat DOT com>
Subject: Re: bash/cmd CTRL-C problem...
Date: Mon, 7 Jan 2002 09:47:59 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

Hi Christopher,

> Here's the harsh reality: it is extremely unlikely that anyone is going
> to investigate this.  If you are using non-cygwin apps with bash and
> CTRL-C doesn't work then you are on your own.

OK.

> I will enthusiastically inspect and evaluate any fixes that you provide
> to cygwin to rectify this situation.  The fixes must not break current
> CTRL-C behavior with cygwin apps.
>
> You are one of a handful of people reporting similar problems.  Everyone
> seems to be trying to do basically the same thing.  They're building
> non-cygwin java apps and complaining that CTRL-C doesn't work right.

It is not a Java app. It is a plain C/C++ app which forks either a C/C++ or
a Java app. You don't have to compile the included Java app, you can just
use the two C/C++ apps to reproduce the problem.
The problem is that the signal handling of the bash is not working correctly
in the C/C++ app which forks others. The CTRL-C (SIGINT) terminates the app
after executing the signal handler in the same way CTRL-BREAK (SIGBREAK)
does but in opposite to the CTRL-BREAK the child processes are not taken
down. The forking app goes into a loop and waits for a flag to be raised
when the SIGINT occurs. But under bash this never happens. The app is always
terminated after handling the signal. After the loop the app tries to send
CTRL-BREAK signals to the child apps and because it is terminated
immediately the code is never reached.

> However, since we are all *cygwin* developers it is not likely that
> we'll want to go to the effort of loading non-cygwin, java software on
> our system to track your problem down for you.

The problem is in a C/C++ app which is linked against Microsoft runtime libs
and the signal handling goes wrong there. First I suspected that it has
something to do with Java but, and that is what the test case shows, it is
independent of it.

I'm "just" use the Cygwin shell environment to have the same shell under NT
as under UNIX. I had a look at how the signal handling in the bash works,
but I found it very complicated and I don't have the time to track it down.
If nobody is interested making non-cygwin apps work the right way under the
bash than I have to use another approach by starting a windows cmd shell to
launch the C/C++ app to make the signal handling work...
The assumption that

> I could be wrong.  Maybe
> someone is actively working on this.  If so, I hope that person steps
> forward and offers some insight into how they are progressing and what
> their proposed fix might be.

That would of course be great...

Thanks,
    Michael



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019