GNU bug report logs -
#40727
27.0.91; 'cl-loop ... across ... and' seems broken
Previous Next
Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>
Date: Mon, 20 Apr 2020 00:34:02 UTC
Severity: normal
Tags: confirmed, fixed
Found in version 27.0.91
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
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 40727 in the body.
You can then email your comments to 40727 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#40727
; Package
emacs
.
(Mon, 20 Apr 2020 00:34:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Philipp Stephani <p.stephani2 <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 20 Apr 2020 00:34:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
In Emacs 26:
emacs -Q -batch -l cl-lib -eval '(cl-loop for x across [1 2] and y across [3 4])'
works (i.e. no error), but in Emacs 27 it gives an error
Symbol’s value as variable is void: --cl-vec--
This doesn't happen with "for" instead of "and", and also doesn't happen
with lists and "in". If it helps, here's the backtrace:
(length --cl-vec--)
(let ((--cl-vec-- [1 2]) (--cl-len-- (length --cl-vec--)) (--cl-idx-- -1) (x nil) (--cl-vec-- [3 4]) (--cl-len-- (length --cl-vec--)) (--cl-idx-- -1) (y nil)) (while (and (< (setq --cl-idx-- (1+ --cl-idx--)) --cl-len--) (< (setq --cl-idx-- (1+ --cl-idx--)) --cl-len--)) (cl-psetq x (aref --cl-vec-- --cl-idx--) y (aref --cl-vec-- --cl-idx--))) nil)
(catch '--cl-block-nil-- (let ((--cl-vec-- [1 2]) (--cl-len-- (length --cl-vec--)) (--cl-idx-- -1) (x nil) (--cl-vec-- [3 4]) (--cl-len-- (length --cl-vec--)) (--cl-idx-- -1) (y nil)) (while (and (< (setq --cl-idx-- (1+ --cl-idx--)) --cl-len--) (< (setq --cl-idx-- (1+ --cl-idx--)) --cl-len--)) (cl-psetq x (aref --cl-vec-- --cl-idx--) y (aref --cl-vec-- --cl-idx--))) nil))
(cl--block-wrapper (catch '--cl-block-nil-- (let ((--cl-vec-- [1 2]) (--cl-len-- (length --cl-vec--)) (--cl-idx-- -1) (x nil) (--cl-vec-- [3 4]) (--cl-len-- (length --cl-vec--)) (--cl-idx-- -1) (y nil)) (while (and (< (setq --cl-idx-- (1+ --cl-idx--)) --cl-len--) (< (setq --cl-idx-- (1+ --cl-idx--)) --cl-len--)) (cl-psetq x (aref --cl-vec-- --cl-idx--) y (aref --cl-vec-- --cl-idx--))) nil)))
(cl-block nil (let ((--cl-vec-- [1 2]) (--cl-len-- (length --cl-vec--)) (--cl-idx-- -1) (x nil) (--cl-vec-- [3 4]) (--cl-len-- (length --cl-vec--)) (--cl-idx-- -1) (y nil)) (while (and (< (setq --cl-idx-- (1+ --cl-idx--)) --cl-len--) (< (setq --cl-idx-- (1+ --cl-idx--)) --cl-len--)) (cl-psetq x (aref --cl-vec-- --cl-idx--) y (aref --cl-vec-- --cl-idx--))) nil))
(cl-loop for x across [1 2] and y across [3 4])
eval((cl-loop for x across [1 2] and y across [3 4]) t)
command-line-1(("-f" "toggle-debug-on-error" "-l" "cl-lib" "-eval" "(cl-loop for x across [1 2] and y across [3 4])"))
command-line()
normal-top-level()
In GNU Emacs 27.0.91 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.13)
of 2020-04-20
Repository revision: a1040861f118881004f59866111f64cd0ae03b7a
Repository branch: emacs-27
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux rodete
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Configured using:
'configure --enable-checking=all --enable-gtk-deprecation-warnings
--enable-gcc-warnings=warn-only --enable-check-lisp-object-type
--with-mailutils --without-pop 'CFLAGS=-O0 -g3' LDFLAGS=-g3'
Configured features:
XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY
LIBSELINUX GNUTLS FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS GTK3
X11 XDBE XIM MODULES THREADS PDUMPER GMP
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-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
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rmc dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec epa epg epg-config gnus-util
rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils phst skeleton
derived edmacro kmacro pcase ffap thingatpt url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json map url-vars mailcap subr-x rx gnutls puny seq
byte-opt gv bytecomp byte-compile cconv dbus xml cl-loaddefs cl-lib
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 tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer 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
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 threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)
Memory information:
((conses 16 63095 5761)
(symbols 48 8435 1)
(strings 32 22388 1823)
(string-bytes 1 711569)
(vectors 16 12506)
(vector-slots 8 174130 5982)
(floats 8 25 34)
(intervals 56 201 0)
(buffers 1000 12))
--
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
If you received this communication by mistake, please don’t forward it to
anyone else (it may contain confidential or privileged information), please
erase all copies of it, including all attachments, and please let the sender
know it went to the wrong person. Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#40727
; Package
emacs
.
(Thu, 30 Apr 2020 12:32:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 40727 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tags 40727 + confirmed
quit
Philipp Stephani <p.stephani2 <at> gmail.com> writes:
> In Emacs 26:
>
> emacs -Q -batch -l cl-lib -eval '(cl-loop for x across [1 2] and y across [3 4])'
>
> works (i.e. no error), but in Emacs 27 it gives an error
>
> Symbol’s value as variable is void: --cl-vec--
>
> This doesn't happen with "for" instead of "and", and also doesn't happen
> with lists and "in".
It's because of [1: bfca19e475]. I think it should be possible to fix
by grouping the bindings put into 'loop-for-bindings', but meanwhile we
should revert that change, at least on the release branch. It doesn't
revert automatically because there was meanwhile another change to use
'cl--push-clause-loop-body' instead of 'push' on the involved lines, but
after manual fixup your example works correctly.
[1: bfca19e475]: 2018-01-08 00:33:15 +0900
cl-loop: Calculate the array length just once
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=bfca19e475c01f13dbacc7f8b7bb1aecf46cb7e4
[0001-Revert-cl-loop-Calculate-the-array-length-just-once.patch (text/plain, attachment)]
[Message part 3 (text/plain, inline)]
By the way, while adding the test case I found an additional regression
involving loop termination by a 'var = ...' clause. I'll open another
bug about it soon.
Added tag(s) confirmed.
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Thu, 30 Apr 2020 12:32:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#40727
; Package
emacs
.
(Thu, 30 Apr 2020 23:42:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 40727 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Noam Postavsky <npostavs <at> gmail.com> writes:
> By the way, while adding the test case I found an additional regression
> involving loop termination by a 'var = ...' clause. I'll open another
> bug about it soon.
Actually, it's very closely connected (only observable after fixing the
original bug, since otherwise the necessary conditions trigger the
--cl-vec-- is void error), so I'll keep it here. When there is a
(cl-loop for VAR across ARRAY and VAR2 = ...) the array index would get
incremented twice per loop. Fixed by the patch below (applies on top of
the patch in my previous message).
[0002-Don-t-increment-array-index-in-cl-loop-twice-Bug-407.patch (text/plain, attachment)]
[Message part 3 (text/plain, inline)]
Eli, is it okay to push both of these to emacs-27? Alternatively,
reverting both fixes to Bug#29799 in addition to the Bug#29866 fix
works:
[0001-Revert-Refix-conditional-step-clauses-in-cl-loop.patch (text/plain, attachment)]
[0002-Revert-cl-loop-Add-missing-guard-condition.patch (text/plain, attachment)]
[0003-Revert-cl-loop-Calculate-the-array-length-just-once.patch (text/plain, attachment)]
[0004-Mark-Bug-29799-tests-as-failing-since-we-reverted-th.patch (text/plain, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#40727
; Package
emacs
.
(Fri, 01 May 2020 06:12:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 40727 <at> debbugs.gnu.org (full text, mbox):
> From: Noam Postavsky <npostavs <at> gmail.com>
> Date: Thu, 30 Apr 2020 19:40:43 -0400
> Cc: 40727 <at> debbugs.gnu.org, Tino Calancha <tino.calancha <at> gmail.com>
>
> Eli, is it okay to push both of these to emacs-27? Alternatively,
> reverting both fixes to Bug#29799 in addition to the Bug#29866 fix
> works:
I prefer reverting, thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#40727
; Package
emacs
.
(Wed, 06 May 2020 01:18:01 GMT)
Full text and
rfc822 format available.
Message #19 received at 40727 <at> debbugs.gnu.org (full text, mbox):
tags 40727 fixed
close 40727 27.1
quit
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Noam Postavsky <npostavs <at> gmail.com>
>> Date: Thu, 30 Apr 2020 19:40:43 -0400
>> Cc: 40727 <at> debbugs.gnu.org, Tino Calancha <tino.calancha <at> gmail.com>
>>
>> Eli, is it okay to push both of these to emacs-27? Alternatively,
>> reverting both fixes to Bug#29799 in addition to the Bug#29866 fix
>> works:
>
> I prefer reverting, thanks.
Okay, I pushed those two to master, and reverted on emacs-27.
[1: 79e133da03]: 2020-05-05 21:07:58 -0400
Revert "Refix conditional step clauses in cl-loop"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=79e133da034cd2d7cccfc5a6eb7db340f2dc45a8
[2: caf155c463]: 2020-05-05 21:07:58 -0400
Revert "cl-loop: Add missing guard condition"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=caf155c4638d4704b2a099657153c9abc115720b
[3: de1b33f5a8]: 2020-05-05 21:07:58 -0400
Revert "cl-loop: Calculate the array length just once"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=de1b33f5a8c6ceee9be59285f70370c3cb2efd34
[4: 1e09364d67]: 2020-05-05 21:07:58 -0400
; Mark Bug#29799 tests as failing since we reverted the fix
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1e09364d677b0fb57efd18369c55e8c2d0e826f5
----
[5: 33c5dc3201]: 2020-05-05 21:05:26 -0400
Revert "cl-loop: Calculate the array length just once"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=33c5dc3201c334703c951360dbc7e83b60db4456
[6: 721dad1829]: 2020-05-05 21:06:07 -0400
Don't increment array index in cl-loop twice (Bug#40727)
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=721dad1829d9c641acd31201b96a0ddf827f0c89
Added tag(s) fixed.
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Wed, 06 May 2020 01:18:01 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 27.1, send any further explanations to
40727 <at> debbugs.gnu.org and Philipp Stephani <p.stephani2 <at> gmail.com>
Request was from
Noam Postavsky <npostavs <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Wed, 06 May 2020 01:18:02 GMT)
Full text and
rfc822 format available.
Message #24 received at 40727-quiet <at> debbugs.gnu.org (full text, mbox):
Noam Postavsky <npostavs <at> gmail.com> writes:
> Okay, I pushed those two to master,
> [5: 33c5dc3201]: 2020-05-05 21:05:26 -0400
> Revert "cl-loop: Calculate the array length just once"
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=33c5dc3201c334703c951360dbc7e83b60db4456
>
> [6: 721dad1829]: 2020-05-05 21:06:07 -0400
> Don't increment array index in cl-loop twice (Bug#40727)
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=721dad1829d9c641acd31201b96a0ddf827f0c89
Actually I forgot to push them, now done as:
[7: de7158598f]: 2020-05-07 08:23:56 -0400
Revert "cl-loop: Calculate the array length just once"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=de7158598fcd5440c0180ff6f83052c29e490bcd
[8: ddc8020327]: 2020-05-07 08:23:56 -0400
Don't increment array index in cl-loop twice (Bug#40727)
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ddc8020327604b92e7e830708933f62a22f48f62
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#40727
; Package
emacs
.
(Sat, 09 May 2020 23:14:02 GMT)
Full text and
rfc822 format available.
Message #27 received at 40727-done <at> debbugs.gnu.org (full text, mbox):
Am Mi., 6. Mai 2020 um 03:17 Uhr schrieb Noam Postavsky <npostavs <at> gmail.com>:
>
> tags 40727 fixed
> close 40727 27.1
> quit
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> From: Noam Postavsky <npostavs <at> gmail.com>
> >> Date: Thu, 30 Apr 2020 19:40:43 -0400
> >> Cc: 40727 <at> debbugs.gnu.org, Tino Calancha <tino.calancha <at> gmail.com>
> >>
> >> Eli, is it okay to push both of these to emacs-27? Alternatively,
> >> reverting both fixes to Bug#29799 in addition to the Bug#29866 fix
> >> works:
> >
> > I prefer reverting, thanks.
>
> Okay, I pushed those two to master, and reverted on emacs-27.
>
Thanks. Confirmed that the problem doesn't happen any more on the
release branch.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 07 Jun 2020 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 71 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.