Subject: bug#17170: 24.3.50; debug: Terminal 3 is locked, cannot read from it

From: Eli Zaretskii <[email-masked]>
Date: Wed, 02 Apr 2014 19:26:20 +0300

> From: Nicolas Richard <[email-masked]>
> Date: Wed, 02 Apr 2014 13:03:29 +0200
> 
> I got the following error message
> debug: Terminal 3 is locked, cannot read from it

This comes from keyboard.c, see the commentary there for details.

> It has already happened to me but I cannot reproduce.

Please try "C-h l" next time, and report the commands that cause this.

> This however only happeend to me in a situation where emacs is run
> (with -nw option) from gdb which is run from tmux and I connect to
> that through ssh and emacsclient.

Perhaps tmux tricks Emacs into some strange situation.

> In this specific occurrence of the problem, that initial frame was
> active (on the host computer) but I was connecting to the emacs session
> from ssh via emacsclient. There was a third frame also, a graphical one,
> on the host computer.
> 
> If I hit ESC ESC ESC, I get the error message again and enter a new
> level of recursive edit (i.e. another layer of brackets in the
> modeline). I can't escape those : C-] just makes also the error again +
> another level of recursive edit.

Do you have debug-on-error set non-nil or something?