GNU bug report logs - #63103
30.0.50; nconc compiler optimization breaks user packages

Previous Next

Package: emacs;

Reported by: Maks <mvproton <at> gmail.com>

Date: Thu, 27 Apr 2023 04:17:04 UTC

Severity: normal

Merged with 63100, 63101

Found in version 30.0.50

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#63103: closed (30.0.50; nconc compiler optimization breaks
 user packages)
Date: Thu, 27 Apr 2023 12:30:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 27 Apr 2023 14:28:58 +0200
with message-id <E90776F9-3E5E-474A-B642-2F1043EFE1E0 <at> acm.org>
and subject line Re: bug#63103: 30.0.50; nconc compiler optimization breaks user packages
has caused the debbugs.gnu.org bug report #63103,
regarding 30.0.50; nconc compiler optimization breaks user packages
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
63103: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63103
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Maks <mvproton <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; nconc compiler optimization breaks user packages
Date: Thu, 27 Apr 2023 01:50:42 +0300
Hello,

I'm sorry if you received similar emails from me, there were problems
with sending.

Commit e6ca5834a6eab91023e9f968b65683d0a74db1e7 ('Improved nconc and append compiler optimisations') breaks
vertico.el package. After very long debugging time I figured out that this commit affects behavior of
`completion-hilit-commonality` function of minibuffer.el. I don't completely understand how it works buf try
do describe some details.

If I set breakpoint before breaking commit to 'vertico--affixate then I'll get next stacktrace
```
Debugger entered--entering a function:
* vertico--affixate((#("report-emacs-bug" 0 1 (face (completions-first-difference))) #("cd" 0 1 (face (completions-first-difference))) #("5x5" 0 1 (face (completions-first-difference))) #("arp" 0 1 (face (completions-first-difference))) #("dbx" 0 1 (face (completions-first-difference))) #("dig" 0 1 (face (completions-first-difference))) #("erc" 0 1 (face (completions-first-difference))) #("ert" 0 1 (face (completions-first-difference))) #("eww" 0 1 (face (completions-first-difference))) #("ftp" 0 1 (face (completions-first-difference)))))
  vertico--arrange-candidates()
  vertico--exhibit()
  ...
```
buf if I do the same after breaking commit I'll get stacktrace
```
Debugger entered--entering a function:
* vertico--affixate((#("report-emacs-bug" 0 1 (face (completions-first-difference))) #("cd" 0 1 (face (completions-first-difference))) #("5x5" 0 1 (face (completions-first-difference))) #("arp" 0 1 (face (completions-first-difference))) #("dbx" 0 1 (face (completions-first-difference))) #("dig" 0 1 (face (completions-first-difference))) #("erc" 0 1 (face (completions-first-difference))) #("ert" 0 1 (face (completions-first-difference))) #("eww" 0 1 (face (completions-first-difference))) #("ftp" 0 1 (face (completions-first-difference))) . 0))
  vertico--arrange-candidates()
  vertico--exhibit()
  ...
```

As you can see, the difference is in the tail of the list. With the such tail vertico.el package crashed with error:
```
Error in post-command-hook (vertico--exhibit): (wrong-type-argument listp 0)
```

But testing `completion-hilit-commonality` in REPL separetely from vertico.el package
give the same result (with 0 at the end of list).

Before sending this report I have tried a lot of versions of the
vertico.el package and have the same result. So I tend to think that problem is not directly
related to package. 


[Message part 3 (message/rfc822, inline)]
From: Mattias Engdegård <mattiase <at> acm.org>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: Philip Kaludercic <philipk <at> posteo.net>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, 63103-done <at> debbugs.gnu.org
Subject: Re: bug#63103: 30.0.50; nconc compiler optimization breaks user
 packages
Date: Thu, 27 Apr 2023 14:28:58 +0200
27 apr. 2023 kl. 12.42 skrev Daniel Mendler <mail <at> daniel-mendler.de>:

> I think it is
> kind of nice that `nconc' can be used as a tool to turn a proper list
> into an improper list and vice versa.

It's a bit obscure, though --

  (setcdr (last X) nil)

is a lot clearer than

  (nconc X nil)

and when the latter is preferred for performance, a comment might be polite to the reader.

Anyway, a fix has been pushed to master, and the manual entry for `nconc` got an extra example.



This bug report was last modified 2 years and 86 days ago.

Previous Next


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