This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: Emacs crashing on C-x C-g


On 10/24/2012 9:09 AM, Ryan Johnson wrote:
On 01/10/2012 4:08 PM, Ryan Johnson wrote:
 > On 01/10/2012 3:07 PM, Ken Brown wrote:
 >> On 10/1/2012 2:51 PM, Ryan Johnson wrote:
 >>> I'm hitting a strange behavior with emacs lately, where hitting
 >>> C-x C-g [1] sometimes causes it to quit instantly: no request to
 >>> save files, no seg fault, no error message, just gone (have to
 >>> reset the terminal to clear out emacs' ncurses settings). It
 >>> invariably happens after I've been away from the terminal for a
 >>> while (days) and then come back use it again.
 >>>
 >>> has anyone else had this happen to them?
 >> I haven't seen it, and I do leave emacs running for days or weeks.
 >> But I almost always run emacs under X, not in a terminal. Also, I
 >> generally use the latest Cygwin snapshot.  Have you tried that?
 >> Maybe you're being bitten by the /etc problem that Corinna fixed in
 >> late July (http://cygwin.com/ml/cygwin/2012-07/msg00666.html).
 > OK, I'll give the snapshot a try when I get a chance.

Rats. I thought it was working, but the problem just it again. This time
the emacs session had just been created by a mercurial check-in (to edit
the changelog message) and crashed when I hit C-g to cancel an ESC I no
longer needed.

Packages:
cygwin snapshot 1.7.17s(0.262/5/3) 20120917
bash-4.1.10-4
emacs-24.2-1
emacs-x11-24.2-1
mercurial-2.3.1-1
mintty-1.1.2-1

This time the crash is reproducible, and the test case below paints an
"interesting" story:

mkdir foo
cd foo
hg init
touch foo
hg add foo
EDITOR='emacs -q -nw' hg ci
ESC C-g
<<<crash>>>
reset
<<<"reset is control-G (^G).">>>
EDITOR='emacs -q -nw' hg ci
C-g
<<<"interrupted!">>>
python
C-g
<<<"KeyboardInterrupt">>>
quit # python still running
reset -i ^c
<<<no message>>>
hg record foo
C-g
<<<"Quit (core dumped)">>>
hg record foo
C-c
<<<"interrupted">>>
python
C-g
<<<"Quit (core dumped)">>>
python
C-c
<<<"KeyboardInterrupt">>>
quit # python still running

Apparently, emacs sets the terminal's interrupt character to ^G, causing
^G to interrupt the python script controlling emacs, causing the latter
to not set interrupt back to ^C (due to abnormal exit), and causing
serious (and permanent) confusion for bash: after setting the interrupt
char back to ^C, ^C behaves as expected, but ^G crashes the app. In
addition to mercurial/python above, the same core dump occurs with
gnuplot, cat, and bash history search (^R).

This looks like a known Emacs issue:


http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12697

I imagine it will be fixed before the release of Emacs 24.3.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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