From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 06 14:22:27 2017 Received: (at submit) by debbugs.gnu.org; 6 Nov 2017 19:22:27 +0000 Received: from localhost ([127.0.0.1]:54565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBmyY-0002nX-ND for submit@debbugs.gnu.org; Mon, 06 Nov 2017 14:22:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBmyW-0002nG-1m for submit@debbugs.gnu.org; Mon, 06 Nov 2017 14:22:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBmyP-00013a-Fq for submit@debbugs.gnu.org; Mon, 06 Nov 2017 14:22:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42756) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eBmyP-00013W-Cc for submit@debbugs.gnu.org; Mon, 06 Nov 2017 14:22:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBmyM-0005Tc-2j for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2017 14:22:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBmyI-000110-Qg for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2017 14:22:14 -0500 Received: from mail.arstecnica.it ([144.76.81.238]:56175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBmyI-0000za-FK for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2017 14:22:10 -0500 Received: from nautilus (assp.arstecnica.it [192.168.1.102]) by mail.arstecnica.it (Postfix) with ESMTPSA id 7094983F0CB for ; Mon, 6 Nov 2017 19:22:04 +0000 (UTC) Received: from nautilus ([31.44.165.109] helo=nautilus) by assp.arstecnica.it with SMTPS(AES256-GCM-SHA384) (2.3.3); 6 Nov 2017 19:22:03 +0000 From: Lele Gaifax To: bug-gnu-emacs@gnu.org Subject: 26.0.90; wrong-type-argument in the Python Flymake backend Date: Mon, 06 Nov 2017 20:22:03 +0100 Message-ID: <87wp33kyas.fsf@metapensiero.it> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Assp-Version: 2.3.3(14029) on assp.arstecnica.it X-Assp-ID: assp.arstecnica.it m1-96124-01912 X-Assp-Session: B0E04568 (mail 1) X-Assp-Envelope-From: lele@metapensiero.it X-Assp-Intended-For: bug-gnu-emacs@gnu.org X-Assp-Client-TLS: yes X-Assp-Server-TLS: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) >From time to time, while editing a python-mode with flymake-mode enabled, I somehow trigger an error in the backend. Unfortunately I'm not able to reproduce the problem in a deterministic way:= it really seems a timing issue, that is I was able to get it quickly adding/removing random characters, but not too fast so to give Flymake the opportunity to run the checker subprocess. My guess is that it is another case of "the checker tool reported a line/col position that does not exist anymore in the buffer", but the traceback below does not seem to support my supposition, where in particular I fail to understand from where the `t' that eventually is given to `cdr' may come fr= om: of course it may very well be due to my extremely low elisp-fu tricking me... :-) Here is a traceback (obtained after re-evaluating the `python--flymake-parse-output' function source): Debugger entered--Lisp error: (wrong-type-argument listp t) cdr(t) (setq end (cdr end)) (prog1 end (setq end (cdr end))) (car-safe (prog1 end (setq end (cdr end)))) (setq end (flymake-diag-region source (string-to-number (match-string lin= eidx)) (and colidx (match-string colidx) (string-to-number (match-string co= lidx)))) beg (car-safe (prog1 end (setq end (cdr end))))) (while (search-forward-regexp rx nil t) (setq msg (match-string msgidx)) = (setq end (flymake-diag-region source (string-to-number (match-string linei= dx)) (and colidx (match-string colidx) (string-to-number (match-string coli= dx)))) beg (car-safe (prog1 end (setq end (cdr end))))) (setq type (or (and= typeidx (match-string typeidx) (assoc-default (match-string typeidx) pytho= n-flymake-msg-alist (function string-match))) (assoc-default msg python-fly= make-msg-alist (function string-match)) :error)) (setq diags (nconc diags (= list (flymake-make-diagnostic source beg end type msg))))) (let* ((msg nil) (end nil) (beg nil) (type nil) (diags nil)) (while (sear= ch-forward-regexp rx nil t) (setq msg (match-string msgidx)) (setq end (fly= make-diag-region source (string-to-number (match-string lineidx)) (and coli= dx (match-string colidx) (string-to-number (match-string colidx)))) beg (ca= r-safe (prog1 end (setq end (cdr end))))) (setq type (or (and typeidx (matc= h-string typeidx) (assoc-default (match-string typeidx) python-flymake-msg-= alist (function string-match))) (assoc-default msg python-flymake-msg-alist= (function string-match)) :error)) (setq diags (nconc diags (list (flymake-= make-diagnostic source beg end type msg))))) (funcall report-fn diags) nil) (save-current-buffer (set-buffer (process-buffer proc)) (goto-char (point= -min)) (let* ((msg nil) (end nil) (beg nil) (type nil) (diags nil)) (while = (search-forward-regexp rx nil t) (setq msg (match-string msgidx)) (setq end= (flymake-diag-region source (string-to-number (match-string lineidx)) (and= colidx (match-string colidx) (string-to-number (match-string colidx)))) be= g (car-safe (prog1 end (setq end (cdr end))))) (setq type (or (and typeidx = (match-string typeidx) (assoc-default (match-string typeidx) python-flymake= -msg-alist (function string-match))) (assoc-default msg python-flymake-msg-= alist (function string-match)) :error)) (setq diags (nconc diags (list (fly= make-make-diagnostic source beg end type msg))))) (funcall report-fn diags)= nil)) (let ((rx (nth 0 python-flymake-command-output-pattern)) (lineidx (nth 1 = python-flymake-command-output-pattern)) (colidx (nth 2 python-flymake-comma= nd-output-pattern)) (typeidx (nth 3 python-flymake-command-output-pattern))= (msgidx (nth 4 python-flymake-command-output-pattern))) (save-current-buff= er (set-buffer (process-buffer proc)) (goto-char (point-min)) (let* ((msg n= il) (end nil) (beg nil) (type nil) (diags nil)) (while (search-forward-rege= xp rx nil t) (setq msg (match-string msgidx)) (setq end (flymake-diag-regio= n source (string-to-number (match-string lineidx)) (and colidx (match-strin= g colidx) (string-to-number (match-string colidx)))) beg (car-safe (prog1 e= nd (setq end (cdr end))))) (setq type (or (and typeidx (match-string typeid= x) (assoc-default (match-string typeidx) python-flymake-msg-alist (function= string-match))) (assoc-default msg python-flymake-msg-alist (function stri= ng-match)) :error)) (setq diags (nconc diags (list (flymake-make-diagnostic= source beg end type msg))))) (funcall report-fn diags) nil))) python--flymake-parse-output(# # #f(compiled-function (&rest args) #)) (progn (python--flymake-parse-output source proc report-fn)) (if (save-current-buffer (set-buffer source) (eq proc python--flymake-pro= c)) (progn (python--flymake-parse-output source proc report-fn))) (unwind-protect (if (save-current-buffer (set-buffer source) (eq proc pyt= hon--flymake-proc)) (progn (python--flymake-parse-output source proc report= -fn))) (kill-buffer (process-buffer proc))) (progn (unwind-protect (if (save-current-buffer (set-buffer source) (eq p= roc python--flymake-proc)) (progn (python--flymake-parse-output source proc= report-fn))) (kill-buffer (process-buffer proc)))) (if (eq 'exit (process-status proc)) (progn (unwind-protect (if (save-cur= rent-buffer (set-buffer source) (eq proc python--flymake-proc)) (progn (pyt= hon--flymake-parse-output source proc report-fn))) (kill-buffer (process-bu= ffer proc))))) (closure ((source . #) (_args) (report-fn .= #f(compiled-function (&rest args) #)) outline-heading-= end-regexp python-shell--interpreter python-shell--interpreter-args ffap-al= ist comint-last-prompt-overlay t) (proc _event) (if (eq 'exit (process-stat= us proc)) (progn (unwind-protect (if (save-current-buffer (set-buffer sourc= e) (eq proc python--flymake-proc)) (progn (python--flymake-parse-output sou= rce proc report-fn))) (kill-buffer (process-buffer proc))))))(# "exited abnormally with code 1\n") Thanks a lot, ciao, lele. --=20 nickname: Lele Gaifax | Quando vivr=C3=B2 di quello che ho pensato ieri real: Emanuele Gaifas | comincer=C3=B2 ad aver paura di chi mi copia. lele@metapensiero.it | -- Fortunato Depero, 1929. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 09 16:30:11 2017 Received: (at 29174) by debbugs.gnu.org; 9 Nov 2017 21:30:11 +0000 Received: from localhost ([127.0.0.1]:60937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCuOp-00039F-EP for submit@debbugs.gnu.org; Thu, 09 Nov 2017 16:30:11 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:54200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCuOn-0002zR-9Z; Thu, 09 Nov 2017 16:30:09 -0500 Received: by mail-wm0-f66.google.com with SMTP id s66so4694625wmf.2; Thu, 09 Nov 2017 13:30:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=9PT8PIGtEWWti+DKMzRXZtqp55jFzJgkr51ZrSWGRBA=; b=EmO+9TO8vziIJWb+ozf/KEVHxoxEWDBezG8Su0TkMpHTqZLK7oj4+rIPCRnECO3luq 0fM4D7Gj/wqr0j/+zKcBunHB/OmFPH5O2gy7gaMtIYR+31BkXBLgVEoTqvNnh4M1C4V2 cXycjEDJDlh1YhyaFw6s9dFK+3Tkso/OS3OHSUTU0vWHikrogAYvkqKisaOqn3Be7vsz TrsEL16K8ZyknHheq/y/ypFWSrsVTuZHGjFV0ksnXzzOJVBHAAX2EwrGd3lWgOJsMjhQ p3UfkuWfasn1WhCZVFey3n8kJ+HZUC3Zd4K56fIGumlcdaBb8y/+QFdX4/senX/rak3g oKCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=9PT8PIGtEWWti+DKMzRXZtqp55jFzJgkr51ZrSWGRBA=; b=q5oWUjek0HcR4ecuyvhYXAWRh227NVwtPBqcIS1K8/7fcHE8JYdElDiBDRQjf7of1l z8hYjbFsyjCXL5u+aUeWCxDPOfPMekZ8KXyKvg6XMRZ59sXnLyY0crJCWdIy5Qcg7HJH O+desibk55SOVLiOlDhg8ZYpgIY2wSOHtDDOUnClPlmRZCgK7EAGgqFmlMY5x5SabrkK PhaiAbH6LxCQjySDkMvV1oM3+3mYouD+MdRUYvN38Ecje1B8QQ0KkgTbSps86ee6YnBy 3rQ+eWcooSOXRyvUya4Az95e31oMxqRN3GRkrI4UbIVCCOvGP91itqzg44Tax0rp2vny XDAw== X-Gm-Message-State: AJaThX5tcjW0KjU7JVIyYBzVbiX83n3gFKQ12kKIaFeZghR+YH92zqAK wP/kQTwO3FMYy+Q1Cg+ujIIIYC6ItHA= X-Google-Smtp-Source: AGs4zMaQj0r2GIpACy3A8N9CCtCbntmzN/e2ZLyb3ZyiwZ3KUjThdTG6tvAQOlQPKPqgLBwz/crJ2g== X-Received: by 10.28.191.80 with SMTP id p77mr993063wmf.85.1510263003383; Thu, 09 Nov 2017 13:30:03 -0800 (PST) Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id g28sm9188862wra.31.2017.11.09.13.30.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Nov 2017 13:30:02 -0800 (PST) From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) To: Lele Gaifax Subject: Re: bug#29174: 26.0.90; wrong-type-argument in the Python Flymake backend References: <87wp33kyas.fsf@metapensiero.it> Date: Thu, 09 Nov 2017 21:29:58 +0000 In-Reply-To: <87wp33kyas.fsf@metapensiero.it> (Lele Gaifax's message of "Mon, 06 Nov 2017 20:22:03 +0100") Message-ID: <87po8ri1ih.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29174 Cc: 29174@debbugs.gnu.org, 29174-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Lele Gaifax writes: >>>From time to time, while editing a python-mode with flymake-mode enabled,= I > somehow trigger an error in the backend. > > Unfortunately I'm not able to reproduce the problem in a deterministic wa= y: it > really seems a timing issue, that is I was able to get it quickly > adding/removing random characters, but not too fast so to give Flymake the > opportunity to run the checker subprocess. > > My guess is that it is another case of "the checker tool reported a line/= col > position that does not exist anymore in the buffer", Yes, that is probably the case, but in that discussion we decided it is normal from time to time, especially if you quickly remove characters from the buffer end after check has already started. So it is probably the "same" case, not another case. > but the traceback below does not seem to support my supposition, where > in particular I fail to understand from where the `t' that eventually > is given to `cdr' may come from: of course it may very well be due to > my extremely low elisp-fu tricking me... :-) The problem is the (beg . end) =3D (flymake-diag-region...) clause in the cl-loop. That call assumes that flymake-diag-region will always return a cons, or nil, but it this case (the invalid region case), it was returning t instead. That doesn't destructure nicely into (beg . end), and so errors with a cryptic backtrace that confused you. Fixed this in 89382780e1729861d98eca6e028ca1c62662a59f. Thanks, Jo=C3=A3o From unknown Mon Aug 18 09:03:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 08 Dec 2017 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator