This is the mail archive of the
mailing list for the Cygwin project.
Re: bash/cmd CTRL-C problem...
> For the record, here is a very simple java test program that I sent to
> we discussed this problem last November. This program simply intercepts
> and runs a shutdown hook prior to shutting down the Java VM. It works fine
> 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....
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html