bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29918: 26.0.90; serial-term error in process filter


From: Lars Ingebrigtsen
Subject: bug#29918: 26.0.90; serial-term error in process filter
Date: Wed, 17 Jul 2019 12:58:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Gemini Lasswell <gazally@runbox.com> writes:

> Lars Ingebrigtsen <larsi@gnus.org> 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 <npostavs@gmail.com>
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]