"emacs -nw" hangs in a terminal

Ken Brown kbrown@cornell.edu
Fri May 25 12:46:00 GMT 2012

On 5/25/2012 6:03 AM, Corinna Vinschen wrote:
> On May 24 08:17, Ken Brown wrote:
>> On 5/23/2012 12:02 PM, Corinna Vinschen wrote:
>>> On May 23 11:56, Ken Brown wrote:
>>>> Based on the emacs code, I think that's right.  But maybe I need to
>>>> download the source for the snapshot I'm using (or build cygwin1.dll
>>>> myself) so that I can step through the first call to select after
>>>> the longjmp and see exactly where the crash is happening.
>>> That would be most helpful.  I don't grok this crash.  It's one of
>>> the "this should never possibly happen" kind...
>> I'm now using an unoptimized build of the 20120523 snapshot.  The
>> gdb session is below.  I first started emacs and started the shell
>> process; this guarantees that when emacs calls select, one of the
>> descriptors is a pty master.  Then I attached gdb and put a
>> breakpoint at the emacs function unwind_to_catch, which is triggered
>> when I press C-g.  It took two presses of C-g to get the crash.  I
>> think the rest is self-explanatory.
> Just to let you know, I looked into this on and off yesterday, but I
> still don't understand what's going on.
> In theory starting the new thread should be harmless.  The threads in
> Cygwin are "cygthreads", which is our own thread pool implementation.
> It doesn't stop existing threads but reuses them.  Only if all
> cygthreads are still in use, another one is started and added to the
> pool.
> I'll look further into this, but I am wondering about this:  Is the
> new Fsignal/Fthrow implementation so much different than the old one
> in emacs 23.x?  If not, why does it work in 23.x?  Any chance 24.x
> produces a stack or heap corruption?  Double free or something?

There's nothing that jumps out at me.

> And then again, do we know if 24.x works on older Cygwin release or
> snapshots?  If it's a Cygwin problem, it might help to nail it down.

It works on the 20120111 snapshot but fails on the 20120122 snapshot. 
Thanks for suggesting this.  It should have been the first thing I checked.


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

More information about the Cygwin mailing list