GNU bug report logs - #35186
26.1; confusing error message and location on eager dotted pair evaluation

Previous Next

Package: emacs;

Reported by: Ernesto Alfonso <erjoalgo <at> gmail.com>

Date: Sun, 7 Apr 2019 21:30:01 UTC

Severity: minor

Found in version 26.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35186 in the body.
You can then email your comments to 35186 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#35186; Package emacs. (Sun, 07 Apr 2019 21:30:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ernesto Alfonso <erjoalgo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 07 Apr 2019 21:30:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ernesto Alfonso <erjoalgo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1;
 confusing error message and location on eager dotted pair evaluation
Date: Sun, 07 Apr 2019 14:26:46 -0700
Originally reported on the flycheck bug tracker:

https://github.com/flycheck/flycheck/issues/1557#event-2240962448

Using a dotted pair that accidently is eagerly evaluated results in a
confusing error message and location.
    
From the flycheck tracker, fmdkdd's steps to reproduce:

    $ cat foo.el
    (defun foo ()
      (some irrelevant form)
      (a . b))
    $ emacs -Q --batch -f batch-byte-compile foo.el
    In toplevel form:
    /tmp/foo.el:1:8:Error: Wrong type argument: sequencep, b


In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2019-04-01 built on debian-x1g4
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description:	Debian GNU/Linux 9.8 (stretch)

Recent messages:
Saving file /home/ealfonso/git/autobuild/autobuild.el...
Wrote /home/ealfonso/git/autobuild/autobuild.el
Mark saved where search started
Loading /home/ealfonso/.gnus-gmail...done
Opening connection to imap.gmail.com via tls...
Quit [18 times]
Saving file /home/ealfonso/private-data/org/master.org...
Wrote /home/ealfonso/private-data/org/master.org
Saving file /home/ealfonso/private-data/org/master.org...
Wrote /home/ealfonso/private-data/org/master.org

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
  text-scale-mode: t
  diff-auto-refine-mode: t
  global-erjoalgo-command-mode: t
  erjoalgo-command-mode: t
  show-paren-mode: t
  global-text-scale-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/ealfonso/git/autobuild/autobuild hides /home/ealfonso/git/dotemacs/lisp/core/autobuild
/home/ealfonso/.emacs.d/elpa/s-20180406.808/s hides /home/ealfonso/git/dotemacs/lisp/libs/s
/home/ealfonso/quicklisp/dists/quicklisp/software/slime-v2.23/contrib/slime-cl-indent hides /home/ealfonso/git/dotemacs/lisp/libs/slime-cl-indent
/home/ealfonso/.emacs.d/elpa/dash-20190320.1406/dash hides /home/ealfonso/git/dotemacs/lisp/libs/dash

Features:
(shadow sort mailalias mail-extr emacsbug network-stream nsm starttls
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art
mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache cl-print
sh-script smie executable misearch multi-isearch dired-aux ffap
face-remap vc-git diff-mode diary-lib diary-loaddefs cal-iso org-rmail
org-mhe org-irc org-info org-gnus nnir gnus-sum gnus-group gnus-undo
gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc
nnoo parse-time gnus-spec gnus-int gnus-range gnus-win org-docview
doc-view jka-compr image-mode org-bibtex bibtex org-bbdb org-w3m
org-agenda files-x tmp-completions tetris-o-1 beeper translation babel
mm-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util mailcap gnus nnheader wid-edit wm-windows
slime-fancy slime-trace-dialog slime-fontifying-fu slime-package-fu
slime-references slime-compiler-notes-tree slime-scratch
slime-presentations bridge slime-macrostep macrostep slime-mdot-fu
slime-enclosing-context slime-fuzzy slime-fancy-trace
slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc
slime-repl elp slime-parse slime hi-lock company-oddmuse
company-keywords company-etags company-gtags company-dabbrev-code
company-dabbrev company-files company-capf company-cmake company-xcode
company-clang company-semantic company-eclim company-template
company-bbdb elec-pair lisp-mnt gud apropos compile etags xref project
arc-mode archive-mode hyperspec browse-url slime-autoloads ox-texinfo
ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn
nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar
ox-html table ox-ascii ox-publish ox org-crypt org-element avl-tree
generator org org-macro org-footnote org-pcomplete pcomplete org-list
org-faces org-entities noutline outline org-version ob-emacs-lisp ob
ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint comint
ansi-color ring ob-core ob-eval org-compat org-macs org-loaddefs
cal-menu calendar cal-loaddefs erc-goodies erc erc-backend erc-compat
thingatpt bbdb-mua bbdb-com crm bbdb-message sendmail message rmc puny
dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
mail-utils gmm-utils mailheader bbdb bbdb-site timezone proxy-mode
project-opener org-omnibar erjoalgo-command-mode command-mode-commands
anonymizer genpass ert pp ewoc debug autobuild-examples autobuild
selcand flycheck cl-extra json map find-func help-mode rx subr-x header2
sticky-windows company edmacro kmacro pcase dedicated dash-functional
plusx my-emacs-settings paren server isearch-fast-reverse buttons
zoom-global easy-mmode quick-yes advice goto-last-change f dash s
finder-inf info cl package easymenu epg-config url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 673320 196983)
 (symbols 48 61368 5)
 (miscs 40 172 969)
 (strings 32 181336 13034)
 (string-bytes 1 5257400)
 (vectors 16 63104)
 (vector-slots 8 1715778 179668)
 (floats 8 375 372)
 (intervals 56 3117 124)
 (buffers 992 27))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35186; Package emacs. (Tue, 09 Jul 2019 16:09:02 GMT) Full text and rfc822 format available.

Message #8 received at 35186 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Ernesto Alfonso <erjoalgo <at> gmail.com>
Cc: 35186 <at> debbugs.gnu.org
Subject: Re: bug#35186: 26.1;
 confusing error message and location on eager dotted pair evaluation
Date: Tue, 09 Jul 2019 18:08:19 +0200
Ernesto Alfonso <erjoalgo <at> gmail.com> writes:

>     $ cat foo.el
>     (defun foo ()
>       (some irrelevant form)
>       (a . b))
>     $ emacs -Q --batch -f batch-byte-compile foo.el
>     In toplevel form:
>     /tmp/foo.el:1:8:Error: Wrong type argument: sequencep, b

That's not an optimal error message; no.

I've been trying to find out what part of the byte compiler/reader
machinery is outputting it, but I haven't found it -- does anybody else
know where this is coming from?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35186; Package emacs. (Tue, 09 Jul 2019 18:25:02 GMT) Full text and rfc822 format available.

Message #11 received at 35186 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Ernesto Alfonso <erjoalgo <at> gmail.com>, 35186 <at> debbugs.gnu.org
Subject: Re: bug#35186: 26.1;
 confusing error message and location on eager dotted pair evaluation
Date: Tue, 09 Jul 2019 20:23:49 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I've been trying to find out what part of the byte compiler/reader
> machinery is outputting it, but I haven't found it -- does anybody else
> know where this is coming from?

AFAICT it comes from these lines (line 776 and following) in
`cconv-analyze-form' in cconv.el:

#+begin_src emacs-lisp
    (`(,_ . ,body-forms)    ; First element is a function or whatever.
     (dolist (form body-forms) (cconv-analyze-form form env)))
#+end_src

It's not an explicit error but just dolist barfing.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35186; Package emacs. (Thu, 20 Aug 2020 15:29:02 GMT) Full text and rfc822 format available.

Message #14 received at 35186 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Ernesto Alfonso <erjoalgo <at> gmail.com>, 35186 <at> debbugs.gnu.org
Subject: Re: bug#35186: 26.1; confusing error message and location on eager
 dotted pair evaluation
Date: Thu, 20 Aug 2020 17:28:08 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> AFAICT it comes from these lines (line 776 and following) in
> `cconv-analyze-form' in cconv.el:
>
> #+begin_src emacs-lisp
>     (`(,_ . ,body-forms)    ; First element is a function or whatever.
>      (dolist (form body-forms) (cconv-analyze-form form env)))
> #+end_src
>
> It's not an explicit error but just dolist barfing.

I've tried sprinkling some messaging liberally over cconv-analyze-form,
and I'm unable to make it trigger in the test case.  It does seem likely
that the error is from a dolist somewhere, but it seems to happen before
we get to that function...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35186; Package emacs. (Thu, 20 Aug 2020 16:04:02 GMT) Full text and rfc822 format available.

Message #17 received at 35186 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Ernesto Alfonso <erjoalgo <at> gmail.com>, 35186 <at> debbugs.gnu.org
Subject: Re: bug#35186: 26.1; confusing error message and location on eager
 dotted pair evaluation
Date: Thu, 20 Aug 2020 18:03:15 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I've tried sprinkling some messaging liberally over cconv-analyze-form,
> and I'm unable to make it trigger in the test case.  It does seem likely
> that the error is from a dolist somewhere, but it seems to happen before
> we get to that function...

Did you enable lexical-binding mode?  I guess it will make a difference.
A had done it AFAIR.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35186; Package emacs. (Thu, 20 Aug 2020 16:29:02 GMT) Full text and rfc822 format available.

Message #20 received at 35186 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Ernesto Alfonso <erjoalgo <at> gmail.com>, 35186 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#35186: 26.1; confusing error message and location on eager
 dotted pair evaluation
Date: Thu, 20 Aug 2020 18:28:11 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> I've tried sprinkling some messaging liberally over cconv-analyze-form,
>> and I'm unable to make it trigger in the test case.  It does seem likely
>> that the error is from a dolist somewhere, but it seems to happen before
>> we get to that function...
>
> Did you enable lexical-binding mode?  I guess it will make a difference.
> A had done it AFAIR.

Ah, yes, that made a difference.  With the following patch I get:

larsi <at> xo:~/src/emacs/trunk$ emake ; ./src/emacs -Q --batch -f batch-byte-compile /tmp/r.el
  ELC      emacs-lisp/cconv.elc

In toplevel form:
/tmp/r.el:3:1: Error: Wrong type argument: proper-list-p, (a . b)

Does this makes sense to everybody?

diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index 351a097ad1..c024cda876 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -750,6 +750,8 @@ cconv-analyze-form
     ;; (`(declare . ,_) nil)               ;The args don't contain code.
 
     (`(,_ . ,body-forms)    ; First element is a function or whatever.
+     (unless (listp body-forms)
+       (signal 'wrong-type-argument (list 'proper-list-p form)))
      (dolist (form body-forms) (cconv-analyze-form form env)))
 
     ((pred symbolp)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35186; Package emacs. (Wed, 22 Sep 2021 21:48:01 GMT) Full text and rfc822 format available.

Message #23 received at 35186 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Ernesto Alfonso <erjoalgo <at> gmail.com>, 35186 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#35186: 26.1; confusing error message and location on eager
 dotted pair evaluation
Date: Wed, 22 Sep 2021 23:47:39 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Does this makes sense to everybody?

There wasn't any response in a year, but the change doesn't seem to lead
to any regressions, and it fixes the reported issue, so I've now pushed
it to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 35186 <at> debbugs.gnu.org and Ernesto Alfonso <erjoalgo <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 22 Sep 2021 21:48:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Oct 2021 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 237 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.