This is the mail archive of the
mailing list for the Cygwin project.
RE: broken CTRL-BREAK handling
- To: "'Heribert Dahms'" <heribert_dahms at icon-scm dot com>, Troy Noble <troy dot noble at channelpoint dot com>, "'cygwin at cygwin dot com'" <cygwin at cygwin dot com>
- Subject: RE: broken CTRL-BREAK handling
- From: Troy Noble <troy dot noble at channelpoint dot com>
- Date: Wed, 18 Jul 2001 15:01:33 -0600
A good suggestion.
Under Linux or Solaris, the standard way of forcing Sun's JVM to dump the
current thread stacks is
$ kill -SIGQUIT <pid-of-your-jvm>
$ kill -3 <pid-of-your-jvm>
On AIX, with IBM's JVM you can use -SIGUSR1.
Not sure of other JVM ports, but that's how the two JVMs
I've used do it.
Unfortunately, the win32 version of Sun's JVM is a
native Win32 app, and doesn't handle signals in *nix fashion...
since it's only got the Win32 API at its disposal. All the
signal handling that cygwin uses/provides is implemented as part of
cygwin in other words.
Sun's JVM registers a console ctrl handler, which when invoked
with type==CTRL_BREAK_EVENT dumps the thread stacks. The
interaction with cygwin is that when I start JVM from cygwin's
bash, a CTRL-BREAK results in a kill of all of the processes in
the process group (including my JVM process) before the JVM's
control handler gets called. Thus the root of my particular
problem, which I was trying to work around.
I [re]discovered that can press the close button ([X]) at the
upper right corner of the bash console window to produce the
stack trace. Not as pretty, and doesn't work in Emacs (C-c C-\),
but it's a work around nonetheless.
Now, if I could get Sun to port their JVM over to cygwin,
and then setup a proper POSIX-style signal handler
such as cygwin provides (which win32 doesn't)... but
then I wake up and realize I'm daydreaming again.
Thanks for the suggestion. It was definitely worth a shot.
From: Heribert Dahms [mailto:email@example.com]
Sent: Wednesday, July 18, 2001 2:42 PM
To: 'Troy Noble'; 'firstname.lastname@example.org'
Subject: RE: broken CTRL-BREAK handling
for the unix-emulation-centered like me it's a non issue
and I'd turn the question into:
Is there a (standard) way of generating a JVM dump under Unix?
If so, you may try that under Cygwin.
Bye, Heribert (email@example.com)
> -----Original Message-----
> From: Troy Noble [SMTP:firstname.lastname@example.org]
> Sent: Wednesday, July 18, 2001 18:33
> To: 'email@example.com'
> Subject: RE: broken CTRL-BREAK handling
> I want to go on record as saying that I'm still not convinced it's
> entirely right for the ctrl handler to swallow the CTRL-BREAK and
> turn it into a SIGINT in all cases. Let me explain. If I press
> CTRL-BREAK in a cmd window JVM dumps stack traces, if I do the same
> in bash/cygwin console window it doesn't.
> Bottom line... that still feels broken to me if the intent is for
> cygwin (more specifically, the bash shell running with cygwin) to
> be able to launch/stop native win32 apps with the same semantics one
> has come to expect when running cmd shell.
> If that's not the goal, then it's a non-issue.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html