From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#24402: should-error doesn't catch all errors Date: Wed, 19 Jul 2017 19:04:57 -0400 Message-ID: <87y3rk9gfa.fsf@users.sourceforge.net> References: <3654D8E9-D3CB-402B-922F-B132C1871E9F@runbox.com> <596E65D2-E780-43A1-A75B-603B61B6F9F4@runbox.com> <87zickhoco.fsf_-_@lylat> <877eznda7v.fsf@lylat> <874lur0zki.fsf@calancha-pc> <87o9sywtbz.fsf@lylat> <87fue3f9p8.fsf@users.sourceforge.net> <87vamyl3j3.fsf@lylat> <87tw2het1b.fsf@users.sourceforge.net> <874luhbo4l.fsf@lylat> <87lgntdswo.fsf@users.sourceforge.net> <87k23d9gvt.fsf@lylat> <87d195dmr0.fsf@users.sourceforge.net> <87lgns7y7g.fsf@lylat> <877ezbew3d.fsf@users.sourceforge.net> <87d193ljdp.fsf@lylat> <87shhxcqit.fsf@users.sourceforge.net> <87inithwi5.fsf@lylat> <87eftcglz3.fsf@runbox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1500505456 3167 195.159.176.226 (19 Jul 2017 23:04:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Jul 2017 23:04:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 24402@debbugs.gnu.org, Alex , Tino Calancha To: Gemini Lasswell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 20 01:04:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXy0o-0000VL-N2 for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Jul 2017 01:04:10 +0200 Original-Received: from localhost ([::1]:35310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXy0u-0002Ga-7x for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Jul 2017 19:04:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXy0k-0002FO-5r for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2017 19:04:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXy0g-0001QV-W2 for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2017 19:04:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45626) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXy0g-0001QP-RF for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2017 19:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dXy0g-0007ju-Hn for bug-gnu-emacs@gnu.org; Wed, 19 Jul 2017 19:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Jul 2017 23:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24402 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed patch Original-Received: via spool by 24402-submit@debbugs.gnu.org id=B24402.150050541129709 (code B ref 24402); Wed, 19 Jul 2017 23:04:02 +0000 Original-Received: (at 24402) by debbugs.gnu.org; 19 Jul 2017 23:03:31 +0000 Original-Received: from localhost ([127.0.0.1]:48303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXy0A-0007j7-PB for submit@debbugs.gnu.org; Wed, 19 Jul 2017 19:03:30 -0400 Original-Received: from mail-io0-f178.google.com ([209.85.223.178]:34856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXy07-0007it-TS for 24402@debbugs.gnu.org; Wed, 19 Jul 2017 19:03:28 -0400 Original-Received: by mail-io0-f178.google.com with SMTP id p185so2717730iof.2 for <24402@debbugs.gnu.org>; Wed, 19 Jul 2017 16:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8zfMefqZkWZyqkdGUTDenDkmENInEgJsKhQDTwFCPNQ=; b=fEWo+Nsb2oN3TZIVlak0hrKQmsS69K2GFsxckZyr1QaIMoUlzxq498A6XoJU0mC7Gf abtTme8ZzgccEi8q75GCgAQsC0r3b/MvXn1Cf9xrdYXmOhIC7zh62h9pQ6r+5wR9QXb/ PLrDatNrNxwKbRwp0Hy2gy/3ye20/MIDB7WFVqG89yh8nwafAD5tq3aJ/Qg7AOWdiHK4 q7YJ2DV2mtfdXvqBtHxw1o60IL/g2SRq0MLvhI8xIaGQ8IXRGghKctbBeMVpOjckjmc1 6WeUSIa0KP8p1M3SC3QQmzi0RwPeztqH025f47dnTx3CiTHnDwcSvTu8GG6leVmASWwm Mk1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=8zfMefqZkWZyqkdGUTDenDkmENInEgJsKhQDTwFCPNQ=; b=uZ1pJc6iDLBslMPwZc6Timt+jEx4p+WnIzrk0oJadcsKEJglYD6Cmq3c1z/6aQatHJ UCh7VkVWprN/NrsiHP5YZGDEiXSLpxmoZfCLpW0v7qg0M6SlDGhCimy19MQGfwRebrRQ YSsDVvZMqK7MvIeuDtUGt965db1+tVg3pYxsB+Z6u7JJwBVs3FmKy1Vg5JwvPcdYXuGJ 4G5IcrD8hFqpAdAVu/DBV/r10SB2MgNzB+jrM7Jiomqj3j0hCFdI1PbxSEBGFgAHw/wU 7vSxonzEv3uezotM4Ntw+vju6bqUvKH06/iYNt8xDd37ffqK80RMXYiHVBDILxOnUEbx 8A2Q== X-Gm-Message-State: AIVw1106fP45GzkxQt/tl7iBjH1cc1xo5uhdzjkv+BueXFqTlGKJG0YG y4d84bXWYCPqOw== X-Received: by 10.107.146.139 with SMTP id u133mr1910591iod.58.1500505402305; Wed, 19 Jul 2017 16:03:22 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 134sm551821ioz.75.2017.07.19.16.03.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jul 2017 16:03:21 -0700 (PDT) In-Reply-To: <87eftcglz3.fsf@runbox.com> (Gemini Lasswell's message of "Wed, 19 Jul 2017 14:23:12 -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: 208.118.235.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:134771 Archived-At: --=-=-= Content-Type: text/plain Gemini Lasswell writes: > This is an excerpt of test/src/fns-tests.el with a few lines added at > the end to invoke Testcover. It contains two nearly identical tests > which should both pass, but one passes and one fails. If I run them again in the same Emacs session then they both fail. The problem seems to be that testcover saves values produced in tests, and when it tries to compare the 2 circular lists produced by these tests, a `circular-list' error is thrown. In other words, this is actually a totally separate bug (although it's hidden until a fix for #24402 is applied). The following appears to fix it, though perhaps we should use a smarter equal function that would consider the circular lists to actually be equal instead of bailing out and returning nil on circularity. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Don-t-error-on-circular-values-in-testcover.patch Content-Description: patch >From 7160e8e45ef9e074360e394f99120d11b7ed4b8a Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 19 Jul 2017 18:48:50 -0400 Subject: [PATCH v1] Don't error on circular values in testcover * lisp/emacs-lisp/testcover.el (testcover-after, testcover-1value): Consider circular lists to be non-equal instead of signaling error. --- lisp/emacs-lisp/testcover.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el index 433ad38a14..bc6004a709 100644 --- a/lisp/emacs-lisp/testcover.el +++ b/lisp/emacs-lisp/testcover.el @@ -463,7 +463,9 @@ (defun testcover-after (idx val) (cond ((eq (aref testcover-vector idx) 'unknown) (aset testcover-vector idx val)) - ((not (equal (aref testcover-vector idx) val)) + ((not (condition-case () + (equal (aref testcover-vector idx) val) + (circular-list nil))) (aset testcover-vector idx 'ok-coverage))) val) @@ -475,7 +477,9 @@ (defun testcover-1value (idx val) ((eq (aref testcover-vector idx) '1value) (aset testcover-vector idx (cons '1value val))) ((not (and (eq (car-safe (aref testcover-vector idx)) '1value) - (equal (cdr (aref testcover-vector idx)) val))) + (condition-case () + (equal (cdr (aref testcover-vector idx)) val) + (circular-list nil)))) (error "Value of form marked with `1value' does vary: %s" val))) val) -- 2.11.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alex writes: > Hmm, this isn't the behaviour that I see. I get the following errors > both with and without my patch, and both interactively and in batch > mode: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Edebug: cyc1 > Edebug: test@test-cycle-assq > Edebug: test@test-cycle-assoc > Edebug: cyc1 > Edebug: test@test-cycle-assq > Edebug: test@test-cycle-assoc > ... > Edebug: cyc1 > Edebug: test@test-cycle-assq > Compiler-macro error for cl--block-wrapper: (error "Lisp nesting exceeds = =E2=80=98max-lisp-eval-depth=E2=80=99") Hmm, that's strange, I don't get that error (or any "Edebug: cyc1" repetitions after the first) on master, or with your patch. --=-=-=--