From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#29918: 26.0.90; serial-term error in process filter Date: Wed, 17 Jul 2019 12:58:51 +0200 Message-ID: <87ims19bbo.fsf@mouse.gnus.org> References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="3641"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 29918@debbugs.gnu.org, Noam Postavsky To: Gemini Lasswell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 17 12:59:12 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 1hnheP-0000kY-BF for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Jul 2019 12:59:09 +0200 Original-Received: from localhost ([::1]:55880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnheM-0001TA-GT for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Jul 2019 06:59:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35203) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnheJ-0001Sq-6y for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 06:59:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnheI-0003H6-23 for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 06:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42773) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hnheH-0003Gb-UK for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 06:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hnheH-0001Sn-QX for bug-gnu-emacs@gnu.org; Wed, 17 Jul 2019 06:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jul 2019 10:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29918 X-GNU-PR-Package: emacs Original-Received: via spool by 29918-submit@debbugs.gnu.org id=B29918.15633611415622 (code B ref 29918); Wed, 17 Jul 2019 10:59:01 +0000 Original-Received: (at 29918) by debbugs.gnu.org; 17 Jul 2019 10:59:01 +0000 Original-Received: from localhost ([127.0.0.1]:51594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnheG-0001SY-QI for submit@debbugs.gnu.org; Wed, 17 Jul 2019 06:59:01 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:46558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnheE-0001SK-Ui for 29918@debbugs.gnu.org; Wed, 17 Jul 2019 06:58:59 -0400 Original-Received: from [80.169.244.84] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hnhe8-0002Bg-NV; Wed, 17 Jul 2019 12:58:56 +0200 In-Reply-To: <87sgr7ottd.fsf@runbox.com> (Gemini Lasswell's message of "Mon, 15 Jul 2019 14:45:50 -0700") 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:163231 Archived-At: Gemini Lasswell writes: > Lars Ingebrigtsen writes: > >> Does setting (setq debug-on-error t) give you a backtrace for these >> errors? > > No, but I just made one happen by removing the internal_condition_case_1 > wrapper on the read_process_output_call in read_and_dispose_of_process_output. > Then after I got the first backtrace showing that the error was in > term-emulate-terminal I eval-defun'd it to make a more useful backtrace: > > Debugger entered--Lisp error: (args-out-of-range "\376\374\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376" -1) > aref("\376\374\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376" -1) > (char-charset (aref decoded-substring (- count 1 partial))) I'm guessing this bug was introduced by: commit 47019a521f774fbd13441e178a6a82c9989b9912 Author: Noam Postavsky Date: Thu Jan 18 08:22:47 2018 -0500 Switch term.el to lexical binding, and clean up code a bit It's a huge patch, though, and it's difficult to follow the changes in logic. The old code had: - (setq count (length decoded-substring)) - ;; Check for multibyte characters that ends - ;; before end of string, and save it for - ;; next time. - (when (= funny str-length) - (let ((partial 0)) - (while (eq (char-charset (aref decoded-substring - (- count 1 partial))) - 'eight-bit) - (cl-incf partial)) (And it's that aref that's failing with (- count 1 partial) being -1, and the new one is + (when (= funny str-length) + (let ((partial 0) + (count (length decoded-substring))) + (while (eq (char-charset (aref decoded-substring + (- count 1 partial))) + 'eight-bit) + (cl-incf partial)) with that length being recalculated that way... Noam? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no