delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/07/12:22:17

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: <032401c1979f$7ba1f390$c51811ac@brokat.de>
From: "Michael Rumpf" <michael AT rumpfonline DOT de>
To: "Gregory W. Bond" <bond AT research DOT att DOT com>, <cygwin AT cygwin DOT com>
References: <3C39C8C1 DOT 6B45A3FB AT research DOT att DOT com> <02b901c19798$5f35d070$c51811ac AT brokat DOT de> <3C39D622 DOT 9C5C8279 AT research DOT att DOT com>
Subject: Re: bash/cmd CTRL-C problem...
Date: Mon, 7 Jan 2002 18:19:37 +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

> For the record, here is a very simple java test program that I sent to
Troy when
> we discussed this problem last November. This program simply intercepts
CTL-C
> and runs a shutdown hook prior to shutting down the Java VM. It works fine
under
> cmd.exe and cygwin ash, but does not work under cygwin bash.

In my test case (myclass.java) I also added a shutdown hook but this app is
spawned as a child process from signals.exe with the CREATE_PROCESS_GROUP
flag enabled. This causes the Win32 kernel to call SetConsoleCtrlHandler on
behalf of the CreateProcess call and disable the CTRL-C handler (See the
MSDN entry for CreateProcess). Therefore child apps can only be killed  by
sending a CTRL-BREAK event. The effect on this is that the VM does not call
the shutdown hooks (And you have to call java with the -Xrs parameter
otherwise you will see just a thread dump of your child process)....

So I see your problem. We are currently not using any Shutdown hooks in our
Java services, but I suspect that we might be in the future and then we will
run into the same troubles you are facing today...

So I'm definitely interested in a solution of your problem as well....

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