From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#6920: 23.2; ESC passed out of order to post-read-conversion Date: Fri, 11 Oct 2019 16:14:51 +0200 Message-ID: References: <4C762592.6080309@ece.cmu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="149057"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 6920@debbugs.gnu.org To: Ryan Johnson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 11 16:16:35 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIvic-000cft-HE for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Oct 2019 16:16:34 +0200 Original-Received: from localhost ([::1]:51190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIvia-0004tN-Qz for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Oct 2019 10:16:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44100) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIvi7-0004p7-KY for bug-gnu-emacs@gnu.org; Fri, 11 Oct 2019 10:16:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIvi6-0000QK-J4 for bug-gnu-emacs@gnu.org; Fri, 11 Oct 2019 10:16:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51246) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iIvi6-0000QE-Fo for bug-gnu-emacs@gnu.org; Fri, 11 Oct 2019 10:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iIvi6-0003Vo-7m for bug-gnu-emacs@gnu.org; Fri, 11 Oct 2019 10:16:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <4C762592.6080309@ece.cmu.edu> Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Oct 2019 14:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6920 X-GNU-PR-Package: emacs Original-Received: via spool by 6920-submit@debbugs.gnu.org id=B6920.157080331213399 (code B ref 6920); Fri, 11 Oct 2019 14:16:02 +0000 Original-Received: (at 6920) by debbugs.gnu.org; 11 Oct 2019 14:15:12 +0000 Original-Received: from localhost ([127.0.0.1]:60067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIvhH-0003U3-PG for submit@debbugs.gnu.org; Fri, 11 Oct 2019 10:15:12 -0400 Original-Received: from mail-pg1-f179.google.com ([209.85.215.179]:38755) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIvhE-0003Td-FM for 6920@debbugs.gnu.org; Fri, 11 Oct 2019 10:15:10 -0400 Original-Received: by mail-pg1-f179.google.com with SMTP id x10so5880966pgi.5 for <6920@debbugs.gnu.org>; Fri, 11 Oct 2019 07:15:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=1fARn3ttu8uP0cDa/50Sw18zZjagmJYX+mnI20Cp1YY=; b=dlH+ibkkt0gYTPauPt48SQ0VbsfztsZPspy4QVXuy2DoA05vn6ZL+5ZDridzxi8hS5 rp9S9g2aesjhqljOlBG+mUn8ypakSXbjOiOC/BLnq51w4vRiCUD0t+A7FwTEZpNNMvQs LQSo1twqmU6wOpNqR3+GliktXbzq70TugA0jQzhrCU4QZghQeciaMOy+RI3oIJAiAZR/ mssiF8YHjF3LVEJQG2CwUfsrzPK3O7jzJmTcKTN4twS+yoNvULvoF3AOFXgkNRy7kJhQ 8S8GH2H6AAEjf+niJ7MQy5Y3CAMYoT2XzZeN7y3gMIMFKNF3rDwn76DBbXQxGBkkrxfg 2j5Q== X-Gm-Message-State: APjAAAV5CKYDJ2ZsjAlsOfDCltsZOXodU7qrJpIcMOx361ZXKm09JLWT 4EA7ZjcDMUbfVCBsM7RmvLiXtaZuTeiqhct8rss= X-Google-Smtp-Source: APXvYqymCI+1LnFwZC1VC0/aD55X37x3HqeaviELAKTH/3PSxxnrVt5PgxFpsobamrlGHK9s0UGBBgSwQwQIKzhtCzo= X-Received: by 2002:a63:1c03:: with SMTP id c3mr16487016pgc.198.1570803302524; Fri, 11 Oct 2019 07:15:02 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:168982 Archived-At: Ryan Johnson writes: > 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'' This was reported 9 years ago but unfortunately never got a reply at the time. Can you still reproduce it on a modern version of Emacs, for example the latest version 26.3? Best regards, Stefan Kangas