From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9470 invoked by alias); 7 Jan 2002 17:18:26 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Received: (qmail 9389 invoked from network); 7 Jan 2002 17:18:20 -0000 Received: from unknown (HELO mail.brokat.de) (212.9.175.131) by sources.redhat.com with SMTP; 7 Jan 2002 17:18:20 -0000 Received: by mail.brokat.de (Smail3.2.0.111/mail.brokat.de) via LF.net GmbH Internet Services via remoteip 172.17.24.197 via remotehost pcmrumpf with smtp for sourceware.cygnus.com id m16NdRj-001mldC; Mon, 7 Jan 2002 18:20:27 +0100 (CET) Message-ID: <032401c1979f$7ba1f390$c51811ac@brokat.de> From: "Michael Rumpf" To: "Gregory W. Bond" , References: <3C39C8C1.6B45A3FB@research.att.com> <02b901c19798$5f35d070$c51811ac@brokat.de> <3C39D622.9C5C8279@research.att.com> Subject: Re: bash/cmd CTRL-C problem... Date: Mon, 07 Jan 2002 09:18:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2002-01/txt/msg00311.txt.bz2 > 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/