emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C-g crash redux


From: Nick Roberts
Subject: Re: C-g crash redux
Date: Fri, 4 Aug 2006 13:49:45 +1200

Chong Yidong writes:
 > >> Typing C-g, which runs interrupt_signal, runs quit_throw_to_read_char
 > >> instead of Fsignal during when waiting_for_input is set (as it is
 > >> during wait_reading_process_output).  If I understand correctly, the
 > >> purpose is to enable read-char to return a `C-g' character; and that's
 > >> why it's both undesirable and unnecesssary to use a
 > >> record_unwind_protect inside wait_reading_process_output.
 > >
 > > Ok, I see.
 > >
 > > But how do we ensure that waiting_for_user_input_p is restored
 > > correctly on C-g?
 > >
 > > Or isn't that necessary?
 > 
 > That's not necessary, since quit_throw_to_read_char calls
 > clear_waiting_for_input, which resets waiting_for_input to 0.

But that might not have been the original value.

 > I guess someone worked all this out at some time in the past.  I added
 > a comment to the code to clarify this.

I'm not convinced that your analysis is correct, but it's in keeping with
the "all bugs must be fixed" policy.

I think that Fsignal should get called (perhaps with QUIT) before Emacs gets
back to the command loop (or at least before further expressions/bytecode is
evaluated) so that unbind_to gets called and the binding stack stays balanced.

-- 
Nick                                           http://www.inet.net.nz/~nickrob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]