I'm running emacs build "GNU Emacs 23.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.24.23) of 2014-11-27 on x86-010.build.bos.redhat.com" on Exceed On Demand (X windows). The following scenario happens to me almost every time I perform it: 1) I save changes in the current buffer, 2) I click on another window and emacs loses focus, 3) when I return focus to the emacs window, the text buffer is unresponsive to keystrokes, the text cursor does not blink, and the only thing that breaks emacs out of this frozen state is to activate a menu bar (simply popping up a menu bar and then dismissing it by clicking on the text buffer is all that's needed). It's driving me crazy, any ideas of how to diagnose this or fix it?
[ Hmm... I should have guessed (having to use the Exceed thingy was a dead give away). ]
Diagnosing this will probably require running under a debugger but your executable probably doesn't have much in terms of debugging info [ I assume step 1 of your scenario doesn't actually make any difference. ] Any chance you could try another Emacs, e.g. the Lucid version instead of the Gtk version?
Here's what you can try (at the Elisp level):
(setq debug-on-event 'sigusr2)
[ You're lucky: this var was introduced in 23.1. ]
Then when your Emacs is stuck, do a
kill -USR2 <emacs-pid>. If you're indeed lucky, it will wake it up and give you a useful backtrace which might help you come up with a workaround. [ Lots of ifs, tho: I wouldn't hold my breath. ]