From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ryan Johnson Newsgroups: gmane.emacs.bugs Subject: bug#6920: 23.2; ESC passed out of order to post-read-conversion Date: Thu, 26 Aug 2010 10:28:02 +0200 Message-ID: <4C762592.6080309@ece.cmu.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1282842177 32718 80.91.229.12 (26 Aug 2010 17:02:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 26 Aug 2010 17:02:57 +0000 (UTC) To: 6920@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 26 19:02:56 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Oofqo-0003eV-Ee for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Aug 2010 19:02:55 +0200 Original-Received: from localhost ([127.0.0.1]:38271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oofqn-00064n-Pk for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Aug 2010 13:02:53 -0400 Original-Received: from [140.186.70.92] (port=50484 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OocRU-00067w-AJ for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2010 09:24:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OocCs-0008JQ-MZ for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2010 09:09:28 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60798) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OocCs-0008JM-Jm for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2010 09:09:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Ooc5h-0001qN-U5; Thu, 26 Aug 2010 09:02:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ryan Johnson Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2010 13:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6920 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.12828276797076 (code B ref -1); Thu, 26 Aug 2010 13:02:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Aug 2010 13:01:19 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ooc50-0001q5-Fn for submit@debbugs.gnu.org; Thu, 26 Aug 2010 09:01:19 -0400 Original-Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OoYAj-0007pA-9C for submit@debbugs.gnu.org; Thu, 26 Aug 2010 04:50:57 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:48870) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OoYC5-0000zV-Vy for submit@debbugs.gnu.org; Thu, 26 Aug 2010 04:52:22 -0400 Original-Received: from [140.186.70.92] (port=58459 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OoYC4-0003VG-5w for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2010 04:52:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OoYC2-0007q0-HR for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2010 04:52:19 -0400 Original-Received: from bache.ece.cmu.edu ([128.2.129.23]:46811) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OoYC2-0007ph-EY for bug-gnu-emacs@gnu.org; Thu, 26 Aug 2010 04:52:18 -0400 Original-Received: from [192.168.0.2] (164-31.76-83.cust.bluewin.ch [83.76.31.164]) by bache.ece.cmu.edu (Postfix) with ESMTP id 63396A0 for ; Thu, 26 Aug 2010 04:28:06 -0400 (EDT) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2 X-detected-operating-system: by eggs.gnu.org: Solaris 9 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Thu, 26 Aug 2010 09:01:16 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 26 Aug 2010 09:02:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Thu, 26 Aug 2010 13:02:45 -0400 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:39769 Archived-At: This problem shows up running in terminal mode on a cygwin xterm, apparently because it sends terminal escape sequences one character at a time (where linux usually sends the whole thing at once). To reproduce, run the following three elisp commands: (define-coding-system 'utf-8-echo "Echoes all input to the message area" :coding-type 'utf-8 :mnemonic ?U :ascii-compatible-p t :charset-list '(unicode) :post-read-conversion 'echo-conversion) (defun echo-conversion (len) (let* ((p (point)) (e (+ p len)) (str (buffer-substring p e))) (message "%s" str) len)) (set-keyboard-coding-system 'utf-8-echo) Then start using the left arrow key to navigate. The escape sequence is '^[OD' and every few arrow presses garbled bits of the "OD" portion will appear in the buffer and the point doesn't move properly. A representative sample of the message buffer looks like this: ^[ O D ^[ O D O D ^[ [2 times] O D The lossage buffer (below) shows how emacs becomes very confused as a result, reporting 'ESC O D O D D O D D ESC' at one point. Defining a similar coding system based on iso-8859-1 instead of utf-8 causes emacs to crash. Unfortunately, cygwin-gdb doesn't trap the signal so I can't produce a stack trace, but sometimes it gets stuck in an endless loop inside malloc, which suggests some sort of memory corruption is the culprit. As far as I know, 'ESC O D' is valid in both coding systems so that shouldn't be the problem. System info follows... In GNU Emacs 23.2.1 (i686-pc-cygwin) of 2010-08-12 on host configured using `configure '--prefix=/home/Ryan/apps/emacs-23.2' '--without-xpm' '--without-png' '--without-gif'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: C.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: ESC [ > 0 ; 2 6 2 ; 0 c ESC ] 1 1 ; r g b : 0 0 0 0 / 0 0 0 0 / 0 0 0 0 ESC \ ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC C-x ESC [ 1 ; 5 B ESC C-x ESC x s e t - k e y TAB RET u t f - 8 - e c h o RET O D D ESC O D ESC O D ESC O D ESC O D O D D ESC O D ESC O D ESC O D ESC O D ESC O D O D D O D D ESC O D ESC O D ESC x r e p o r t - e m TAB RET Recent messages: t - e m ^M E S C ^M Load-path shadows: None found. Features: (shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml easymenu mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-utils emacsbug tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process x multi-tty emacs)