Subject: bug#8472: 24.0.50; weird emacs bugs causing data lossage

From: Eli Zaretskii <[email-masked]>
Date: Mon, 11 Apr 2011 05:36:06 -0400

> From: [email-masked]
> Cc: [email-masked]
> Date: Mon, 11 Apr 2011 11:25:23 +0200
> 
> I got it working by suspending gdb and resuming it again. and sending
> signals to Emacs (I was a bit furious so this part is a bit hazy)

So from that point on, please use the procedure in etc/DEBUG to find
out where it is looping.

> Ok. So the hang happens somewhere else. The symptom is that nothing
> happens on the display but emacsclient can communicate.

Do you remember what was displayed in the minibuffer at that point, by
any chance?  Was it a single screen line or more than that?  Or maybe
only part of the text was visible, i.e. Emacs froze when it tried to
enlarge (a.k.a. "resize") the echo area?

> Also, whenever I manage to break into the process with gdb the backtrace
> shows Emacs is in the select call. With strace I see that Emacs is not
> stuck there but loops.

This is normal, or at least it could be normal: Emacs usually checks
for any arriving input from any possible sources, and that includes
calls to `select'.  Seeing a lot of calls to `select' is not in itself
a sign of an infloop.  Only the procedure in etc/DEBUG (or something
similar) can give a definitive answer to that.

> So I figure theres some poll loop running closely around the select.

Emacs does that all the time, that's how it knows that input arrived
from a subprocess or a socket, for example.  It polls.

> >> - the file was truncated. Maybe this is due to a combination of
> >>   narrowing and automatic save.
> >
> > Can't happen, auto-save forces temporary widening of the buffer (as
> > you'd expect ;-).
> 
> Well. The funny thing is that the truncated content of the file is the
> exact same content I see in the narrowed buffer on screen.
> 
> Org narrows in another window and buffer somehow. Could that interfere?
> I dont know the term for what it does yet. "indirect buffer" maybe?

Could be.  IOW, if auto-save happened in a buffer whose contents was
just the text you found in the auto-save file.