This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

broken CTRL-BREAK handling


In exceptions.cc:ctrl_c_handler

I think the following code should be added:

  /* Return FALSE to allow other control handlers to handle CTRL-BREAK */
  if (type == CTRL_BREAK_EVENT)
      return FALSE;

before the section of code that checks the pids, sids, pgids etc. and
eventually culminates in a

      kill (-myself->pid, SIGINT);

Without this code, the current behavior in cygwin 1.3.2 is to send
SIGINT to the process group whether you press CTRL-C or
CTRL-BREAK.

Certain Win32 programs like JDK's java have their own Ctrl handlers that
watch for CTRL_BREAK_EVENT and dump a stack trace to stdout when
you press CTRL_BREAK or the [X] button in the upper right of the console
window.  Since cygwin's ctrl_c_handler traps the CTRL_BREAK_EVENT
and kills the process group, the JVM never gets a chance to handle the
CTRL_BREAK_EVENT itself.

I have been using the cygwin-1.3.2-1, which is where I saw this.  So
I also checked the latest cvs sources, and it's broken there too.

Thoughts?  Should I submit a patch to this effect?

I have of course patched and recompiled my own DLL, and it works
great.  But thought you might want to know about it too.

Thanks, Troy


--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]